Remove GreenSock from att-abs-tpls.js
[vid.git] / epsdk-app-onap / src / main / webapp / app / fusion / external / ebz / sandbox / att-abs-tpls.js
1 /**\r
2 * FileName att-style-guide\r
3 * Version 2.17.0\r
4 * Build number 5c64ecd381d5984c483cdfaa078a1890\r
5 * Date 11/23/2015\r
6 */\r
7 \r
8 (function(angular, window){\r
9 angular.module("att.abs", ["att.abs.tpls", "att.abs.utilities","att.abs.position","att.abs.transition","att.abs.accordion","att.abs.alert","att.abs.boardStrip","att.abs.breadCrumbs","att.abs.buttons","att.abs.checkbox","att.abs.colorselector","att.abs.datepicker","att.abs.devNotes","att.abs.dividerLines","att.abs.dragdrop","att.abs.drawer","att.abs.message","att.abs.formField","att.abs.hourpicker","att.abs.iconButtons","att.abs.links","att.abs.loading","att.abs.modal","att.abs.pagination","att.abs.paneSelector","att.abs.tooltip","att.abs.popOvers","att.abs.profileCard","att.abs.progressBars","att.abs.radio","att.abs.scrollbar","att.abs.search","att.abs.select","att.abs.slider","att.abs.splitButtonDropdown","att.abs.splitIconButton","att.abs.stepSlider","att.abs.steptracker","att.abs.table","att.abs.tableMessages","att.abs.tabs","att.abs.tagBadges","att.abs.textOverflow","att.abs.toggle","att.abs.treeview","att.abs.typeAhead","att.abs.verticalSteptracker","att.abs.videoControls"]);\r
10 angular.module("att.abs.tpls", ["app/scripts/ng_js_att_tpls/accordion/accordion.html","app/scripts/ng_js_att_tpls/accordion/accordion_alt.html","app/scripts/ng_js_att_tpls/accordion/attAccord.html","app/scripts/ng_js_att_tpls/accordion/attAccordBody.html","app/scripts/ng_js_att_tpls/accordion/attAccordHeader.html","app/scripts/ng_js_att_tpls/alert/alert.html","app/scripts/ng_js_att_tpls/boardStrip/attAddBoard.html","app/scripts/ng_js_att_tpls/boardStrip/attBoard.html","app/scripts/ng_js_att_tpls/boardStrip/attBoardStrip.html","app/scripts/ng_js_att_tpls/buttons/buttonDropdown.html","app/scripts/ng_js_att_tpls/colorselector/colorselector.html","app/scripts/ng_js_att_tpls/datepicker/dateFilter.html","app/scripts/ng_js_att_tpls/datepicker/dateFilterList.html","app/scripts/ng_js_att_tpls/datepicker/datepicker.html","app/scripts/ng_js_att_tpls/datepicker/datepickerPopup.html","app/scripts/ng_js_att_tpls/dividerLines/dividerLines.html","app/scripts/ng_js_att_tpls/dragdrop/fileUpload.html","app/scripts/ng_js_att_tpls/formField/attFormFieldValidationAlert.html","app/scripts/ng_js_att_tpls/formField/attFormFieldValidationAlertPrv.html","app/scripts/ng_js_att_tpls/formField/creditCardImage.html","app/scripts/ng_js_att_tpls/formField/cvcSecurityImg.html","app/scripts/ng_js_att_tpls/hourpicker/hourpicker.html","app/scripts/ng_js_att_tpls/links/readMore.html","app/scripts/ng_js_att_tpls/loading/loading.html","app/scripts/ng_js_att_tpls/modal/backdrop.html","app/scripts/ng_js_att_tpls/modal/tabbedItem.html","app/scripts/ng_js_att_tpls/modal/tabbedOverlayItem.html","app/scripts/ng_js_att_tpls/modal/window.html","app/scripts/ng_js_att_tpls/pagination/pagination.html","app/scripts/ng_js_att_tpls/paneSelector/innerPane.html","app/scripts/ng_js_att_tpls/paneSelector/paneGroup.html","app/scripts/ng_js_att_tpls/paneSelector/sidePane.html","app/scripts/ng_js_att_tpls/tooltip/tooltip-popup.html","app/scripts/ng_js_att_tpls/popOvers/popOvers.html","app/scripts/ng_js_att_tpls/profileCard/addUser.html","app/scripts/ng_js_att_tpls/profileCard/profileCard.html","app/scripts/ng_js_att_tpls/progressBars/progressBars.html","app/scripts/ng_js_att_tpls/scrollbar/scrollbar.html","app/scripts/ng_js_att_tpls/search/search.html","app/scripts/ng_js_att_tpls/select/select.html","app/scripts/ng_js_att_tpls/select/textDropdown.html","app/scripts/ng_js_att_tpls/slider/maxContent.html","app/scripts/ng_js_att_tpls/slider/minContent.html","app/scripts/ng_js_att_tpls/slider/slider.html","app/scripts/ng_js_att_tpls/splitButtonDropdown/splitButtonDropdown.html","app/scripts/ng_js_att_tpls/splitButtonDropdown/splitButtonDropdownItem.html","app/scripts/ng_js_att_tpls/splitIconButton/splitIcon.html","app/scripts/ng_js_att_tpls/splitIconButton/splitIconButton.html","app/scripts/ng_js_att_tpls/splitIconButton/splitIconButtonGroup.html","app/scripts/ng_js_att_tpls/stepSlider/attStepSlider.html","app/scripts/ng_js_att_tpls/steptracker/step-tracker.html","app/scripts/ng_js_att_tpls/steptracker/step.html","app/scripts/ng_js_att_tpls/steptracker/timeline.html","app/scripts/ng_js_att_tpls/steptracker/timelineBar.html","app/scripts/ng_js_att_tpls/steptracker/timelineDot.html","app/scripts/ng_js_att_tpls/table/attTable.html","app/scripts/ng_js_att_tpls/table/attTableBody.html","app/scripts/ng_js_att_tpls/table/attTableHeader.html","app/scripts/ng_js_att_tpls/tableMessages/attTableMessage.html","app/scripts/ng_js_att_tpls/tableMessages/attUserMessage.html","app/scripts/ng_js_att_tpls/tabs/floatingTabs.html","app/scripts/ng_js_att_tpls/tabs/genericTabs.html","app/scripts/ng_js_att_tpls/tabs/menuTab.html","app/scripts/ng_js_att_tpls/tabs/parentmenuTab.html","app/scripts/ng_js_att_tpls/tabs/simplifiedTabs.html","app/scripts/ng_js_att_tpls/tabs/submenuTab.html","app/scripts/ng_js_att_tpls/tagBadges/tagBadges.html","app/scripts/ng_js_att_tpls/toggle/demoToggle.html","app/scripts/ng_js_att_tpls/typeAhead/typeAhead.html","app/scripts/ng_js_att_tpls/verticalSteptracker/vertical-step-tracker.html","app/scripts/ng_js_att_tpls/videoControls/photoControls.html","app/scripts/ng_js_att_tpls/videoControls/videoControls.html"]);\r
11 angular.module('att.abs.utilities', [])\r
12 \r
13 .filter('unsafe',[ '$sce', function ($sce) {\r
14         return function(val){\r
15        return $sce.trustAsHtml(val);\r
16     };\r
17 }])\r
18 \r
19 .filter('highlight', function () {\r
20     function escapeRegexp(queryToEscape) {\r
21         return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');\r
22     }\r
23     return function (matchItem, query, className) {\r
24         return query && matchItem ? matchItem.replace(new RegExp(escapeRegexp(query), 'gi'), '<span class=\"' + className + '\">$&</span>') : matchItem;\r
25     };\r
26 })\r
27 \r
28 .filter('attLimitTo', function() {\r
29     return function(actualArray, _limit, _begin) {\r
30         var finalArray = [];\r
31         var limit = _limit;\r
32         var begin = _begin;\r
33         if(isNaN(begin)) {\r
34             begin = 0;\r
35         }\r
36         if(actualArray && !isNaN(limit)) {\r
37             finalArray = actualArray.slice(begin, begin+limit);\r
38         } else {\r
39             finalArray = actualArray;\r
40         }\r
41         return finalArray;\r
42     };\r
43 })\r
44 \r
45 .filter('startsWith', function() {\r
46     if (typeof String.prototype.startsWith !== 'function') {\r
47         // see below for better implementation!\r
48         String.prototype.startsWith = function (str){\r
49             return this.indexOf(str) === 0;\r
50         };\r
51     }\r
52 \r
53     return function(items, searchString) {\r
54         if (searchString === undefined || searchString === "") {\r
55             return items;\r
56         }\r
57 \r
58         var filtered = [];\r
59         angular.forEach(items, function(item) {\r
60             if (item.title.toLowerCase().startsWith(searchString.toLowerCase())) {\r
61                 filtered.push(item);\r
62             }\r
63         });\r
64         return filtered;\r
65     };\r
66 })\r
67 \r
68 .directive('attInputDeny', [function() {\r
69     return {\r
70         restrict: 'A',\r
71         require: 'ngModel',\r
72         link: function (scope, elem, attr, ctrl) {\r
73             var regexExpression = null;\r
74             attr.$observe('attInputDeny', function (value) {\r
75                 if (value) {\r
76                     regexExpression = new RegExp(value, 'g');\r
77                 }\r
78             });\r
79             elem.bind('input', function () {\r
80                 var inputString = ctrl.$viewValue && ctrl.$viewValue.replace(regexExpression, '');\r
81                 if (inputString !== ctrl.$viewValue) {\r
82                     ctrl.$setViewValue(inputString);\r
83                     ctrl.$render();\r
84                     scope.$apply();\r
85                 }\r
86             });\r
87         }\r
88     };\r
89 }])\r
90 \r
91 .directive('attAccessibilityClick', [function() {\r
92     return {\r
93         restrict: 'A',\r
94         link: function (scope, elem, attr) {\r
95             var keyCode = [];\r
96             attr.$observe('attAccessibilityClick', function (value) {\r
97                 if (value) {\r
98                     keyCode = value.split(',');\r
99                 }\r
100             });\r
101             elem.bind('keydown', function (ev) {\r
102                 var keyCodeCondition = function(){\r
103                     var flag = false;\r
104                     if(!(ev.keyCode)){\r
105                         if(ev.which){\r
106                             ev.keyCode = ev.which;\r
107                         }\r
108                         else if(ev.charCode){\r
109                             ev.keyCode = ev.charCode;\r
110                         }\r
111                     }\r
112                     if((ev.keyCode && keyCode.indexOf(ev.keyCode.toString()) > -1)){\r
113                         flag = true;\r
114                     }\r
115                     return flag;\r
116                 };\r
117                 if(keyCode.length > 0 && keyCodeCondition()) {\r
118                     elem[0].click();\r
119                     ev.preventDefault();\r
120                 }\r
121             });\r
122         }\r
123     };\r
124 }])\r
125 \r
126 .directive('attElementFocus', [function() {\r
127     return {\r
128         restrict: 'A',\r
129         link: function(scope, elem, attr) {\r
130             scope.$watch(attr.attElementFocus, function (value) {\r
131                 if (value) {\r
132                     elem[0].focus();\r
133                 }\r
134             });\r
135         }\r
136     };\r
137 }])\r
138 \r
139 .directive('focusOn', ['$timeout',\r
140     function ($timeout) {\r
141         var checkDirectivePrerequisites = function (attrs) {\r
142           if (!attrs.focusOn && attrs.focusOn !== '') {\r
143                 throw 'FocusOnCondition missing attribute to evaluate';\r
144           }\r
145         };\r
146         return {            \r
147             restrict: 'A',\r
148             link: function (scope, element, attrs) {\r
149                 checkDirectivePrerequisites(attrs);\r
150 \r
151                 scope.$watch(attrs.focusOn, function (currentValue) {\r
152                     if(currentValue) {\r
153                         $timeout(function () {                                             \r
154                             element[0].focus();\r
155                         });\r
156                     }\r
157                 });\r
158             }\r
159         };\r
160     }\r
161 ])\r
162 .constant('whenScrollEndsConstants', {\r
163     'threshold': 100,\r
164     'width': 0,\r
165     'height': 0\r
166 })\r
167 .directive('whenScrollEnds', function(whenScrollEndsConstants, $log) {\r
168     return {\r
169         restrict: 'A',\r
170         link: function (scope, element, attrs) {\r
171             /**\r
172             * Exposed Attributes:\r
173             *       threshold - integer - number of pixels before scrollbar hits end that callback is called\r
174             *       width - integer - override for element's width (px)\r
175             *       height - integer - override for element's height (px)\r
176             *       axis - string - x/y for scroll bar axis\r
177             */\r
178             var threshold = parseInt(attrs.threshold, 10) || whenScrollEndsConstants.threshold;\r
179 \r
180             if (!attrs.axis || attrs.axis === '') {\r
181                 $log.warn('axis attribute must be defined for whenScrollEnds.');\r
182                 return;\r
183             }\r
184 \r
185             if (attrs.axis === 'x') {\r
186                 visibleWidth = parseInt(attrs.width, 10) || whenScrollEndsConstants.width;\r
187                 if (element.css('width')) {\r
188                     visibleWidth = element.css('width').split('px')[0];  \r
189                 }\r
190 \r
191                 element[0].addEventListener('scroll', function() {\r
192                     var scrollableWidth = element.prop('scrollWidth');\r
193                     if (scrollableWidth === undefined) {\r
194                         scrollableWidth = 1;\r
195                     }\r
196                     var hiddenContentWidth = scrollableWidth - visibleWidth;\r
197 \r
198                     if (hiddenContentWidth - element[0].scrollLeft <= threshold) {\r
199                         /* Scroll almost at bottom, load more rows */\r
200                         scope.$apply(attrs.whenScrollEnds);\r
201                     }\r
202                 });\r
203             } else if (attrs.axis === 'y') {\r
204                 visibleHeight = parseInt(attrs.height, 10) || whenScrollEndsConstants.height;\r
205                 if (element.css('width')) {\r
206                     visibleHeight = element.css('height').split('px')[0]; \r
207                 }\r
208 \r
209                 element[0].addEventListener('scroll', function() {\r
210                     var scrollableHeight = element.prop('scrollHeight');\r
211                     if (scrollableHeight === undefined) {\r
212                         scrollableHeight = 1;\r
213                     }\r
214                     var hiddenContentHeight = scrollableHeight - visibleHeight;\r
215 \r
216                     if (hiddenContentHeight - element[0].scrollTop <= threshold) {\r
217                         /* Scroll almost at bottom, load more rows */\r
218                         scope.$apply(attrs.whenScrollEnds);\r
219                     }\r
220                 });\r
221             }\r
222         }\r
223     };\r
224 })\r
225 \r
226 .directive("validImei", function(){          \r
227     return {\r
228         restrict: 'A',\r
229         require: 'ngModel',\r
230         link: function(scope, ele, attrs, ctrl)\r
231         {       \r
232             ctrl.$parsers.unshift(function(value) \r
233             {\r
234                 if(value){                    \r
235                     scope.valid = false;\r
236                     if (!isNaN(value) && value.length === 15)\r
237                     {\r
238                         var sumImeiVal = 0;     \r
239                         var posIMEI = [];\r
240                         for (var imeiIndex=0; imeiIndex<15; imeiIndex++)\r
241                         {\r
242                             posIMEI[imeiIndex] =  parseInt(value.substring(imeiIndex,imeiIndex + 1),10);\r
243                             if (imeiIndex % 2 !== 0)\r
244                             {\r
245                                 posIMEI[imeiIndex] = parseInt((posIMEI[imeiIndex] * 2),10);                                        \r
246                             }\r
247                             if (posIMEI[imeiIndex] > 9)\r
248                             {    \r
249                                 posIMEI[imeiIndex] = parseInt((posIMEI[imeiIndex] % 10),10) + parseInt((posIMEI[imeiIndex] / 10),10);                                        \r
250                             }\r
251                             sumImeiVal=sumImeiVal+parseInt((posIMEI[imeiIndex]),10);\r
252                         }\r
253 \r
254                         if((sumImeiVal % 10) === 0)\r
255                         {\r
256                             scope.valid = true;                            \r
257                         }\r
258                         else\r
259                         {\r
260                             scope.valid = false;                            \r
261                         }                                \r
262                     }\r
263                     else \r
264                     {\r
265                         scope.valid = false;                        \r
266                     }                    \r
267                     ctrl.$setValidity('invalidImei', scope.valid);\r
268                 }\r
269                 return scope.valid ? value : undefined;\r
270             });\r
271         }\r
272     };\r
273 })\r
274 \r
275 .directive("togglePassword", function(){\r
276     return{\r
277         restrict:'A',        \r
278         transclude:false,\r
279         link: function(scope, element, attr, ctrl)\r
280         {\r
281             element.bind("click", function() \r
282             {\r
283                 var ipwd = attr.togglePassword;\r
284                 element[0].innerHTML = element[0].innerHTML === "Show" ? "Hide" : "Show";                \r
285                 var e = angular.element(document.querySelector('#' + ipwd))[0].type;\r
286                 angular.element(document.querySelector('#' + ipwd))[0].type = e === "password"? "text" : "password";\r
287                 \r
288             });      \r
289                        \r
290         }\r
291     };\r
292 })\r
293 \r
294 .factory('events', function(){\r
295     var _stopPropagation =  function(evt){\r
296         if(evt.stopPropagation) {\r
297             evt.stopPropagation();\r
298         } else {\r
299             evt.returnValue = false;\r
300         }\r
301     };\r
302     var _preventDefault = function(evt) {\r
303         if (evt.preventDefault) {\r
304             evt.preventDefault();\r
305         } else {\r
306             evt.returnValue = false;\r
307         }\r
308     }\r
309     return {\r
310         stopPropagation: _stopPropagation,\r
311         preventDefault: _preventDefault\r
312     };\r
313 })\r
314 \r
315 .factory('$documentBind', ['$document', '$timeout', function ($document, $timeout) {\r
316     var _click = function (flag, callbackFunc, scope) {\r
317         scope.$watch(flag, function (val) {\r
318             $timeout(function () {\r
319                 if (val) {\r
320                     $document.bind('click', callbackFunc);\r
321                 } else {\r
322                     $document.unbind('click', callbackFunc);\r
323                 }\r
324             });\r
325         });\r
326     };\r
327 \r
328     var _event = function (event, flag, callbackFunc, scope, timeoutFlag, timeoutValue) {\r
329         if (timeoutFlag) {\r
330             if (!(timeoutValue)) {\r
331                 timeoutValue = 0;\r
332             }\r
333             scope.$watch(flag, function (newVal, oldVal) {\r
334                 if (newVal !== oldVal) {\r
335                     $timeout(function () {\r
336                         if (newVal) {\r
337                             $document.bind(event, callbackFunc);\r
338                         } else {\r
339                             $document.unbind(event, callbackFunc);\r
340                         }\r
341                     }, timeoutValue);\r
342                 }\r
343             });\r
344         } else {\r
345             scope.$watch(flag, function (newVal, oldVal) {\r
346                 if (newVal !== oldVal) {\r
347                     if (newVal) {\r
348                         $document.bind(event, callbackFunc);\r
349                     } else {\r
350                         $document.unbind(event, callbackFunc);\r
351                     }\r
352                 }\r
353             });\r
354         }\r
355     };\r
356 \r
357     return {\r
358         click: _click,\r
359         event: _event\r
360     };\r
361 }])\r
362 \r
363 .factory('DOMHelper', function() {\r
364 \r
365     function isTabable(node) {\r
366         var element = angular.element(node);\r
367         var hasTabindex = (parseInt(element.attr('tabindex'), 10) >= 0) ? true : false;\r
368         var tagName = element[0].tagName.toUpperCase();\r
369 \r
370         if (hasTabindex || tagName === 'A' || tagName === 'INPUT' || tagName === 'TEXTAREA') {\r
371             return !(element[0].disabled || element[0].readOnly);\r
372         }\r
373         return false;\r
374     }\r
375 \r
376     function isValidChild(child) {\r
377         return child.nodeType == 1 && child.nodeName != 'SCRIPT' && child.nodeName != 'STYLE';\r
378     }\r
379 \r
380     function traverse(obj) {\r
381         var obj = obj || document.getElementsByTagName('body')[0];\r
382         if (isValidChild(obj) && isTabable(obj)) {\r
383             return obj;\r
384         } \r
385         if (obj.hasChildNodes()) {\r
386             var child = obj.firstChild;\r
387             while(child) {\r
388                 var res =  traverse(child);\r
389                 if(res){\r
390                     return res;\r
391                 }\r
392                 else{\r
393                     child = child.nextSibling;\r
394                 }\r
395             }\r
396         }\r
397         else{\r
398             return undefined;\r
399         }\r
400     }\r
401 \r
402     var _firstTabableElement = function(el) {\r
403         /* This will return the first tabable element from the parent el */\r
404         var elem = el;\r
405         if (el.hasOwnProperty('length')) {\r
406             elem = el[0];\r
407         }\r
408 \r
409         return traverse(elem);\r
410     };\r
411 \r
412     return {\r
413         firstTabableElement: _firstTabableElement\r
414     };\r
415 })\r
416 \r
417 .factory('keymap', function(){\r
418     return {\r
419     KEY:{\r
420         TAB: 9,\r
421         ENTER: 13,\r
422         ESC: 27,\r
423         SPACE: 32,\r
424         LEFT: 37,\r
425         UP: 38,\r
426         RIGHT: 39,\r
427         DOWN: 40,\r
428         SHIFT: 16,\r
429         CTRL: 17,\r
430         ALT: 18,\r
431         PAGE_UP: 33,\r
432         PAGE_DOWN: 34,\r
433         HOME: 36,\r
434         END: 35,\r
435         BACKSPACE: 8,\r
436         DELETE: 46,\r
437         COMMAND: 91\r
438         },\r
439         MAP: { 91 : "COMMAND", 8 : "BACKSPACE" , 9 : "TAB" , 13 : "ENTER" , 16 : "SHIFT" , 17 : "CTRL" , 18 : "ALT" , 19 : "PAUSEBREAK" , 20 : "CAPSLOCK" , 27 : "ESC" , 32 : "SPACE" , 33 : "PAGE_UP", 34 : "PAGE_DOWN" , 35 : "END" , 36 : "HOME" , 37 : "LEFT" , 38 : "UP" , 39 : "RIGHT" , 40 : "DOWN" , 43 : "+" , 44 : "PRINTSCREEN" , 45 : "INSERT" , 46 : "DELETE", 48 : "0" , 49 : "1" , 50 : "2" , 51 : "3" , 52 : "4" , 53 : "5" , 54 : "6" , 55 : "7" , 56 : "8" , 57 : "9" , 59 : ";", 61 : "=" , 65 : "A" , 66 : "B" , 67 : "C" , 68 : "D" , 69 : "E" , 70 : "F" , 71 : "G" , 72 : "H" , 73 : "I" , 74 : "J" , 75 : "K" , 76 : "L", 77 : "M" , 78 : "N" , 79 : "O" , 80 : "P" , 81 : "Q" , 82 : "R" , 83 : "S" , 84 : "T" , 85 : "U" , 86 : "V" , 87 : "W" , 88 : "X" , 89 : "Y" , 90 : "Z", 96 : "0" , 97 : "1" , 98 : "2" , 99 : "3" , 100 : "4" , 101 : "5" , 102 : "6" , 103 : "7" , 104 : "8" , 105 : "9", 106 : "*" , 107 : "+" , 109 : "-" , 110 : "." , 111 : "/", 112 : "F1" , 113 : "F2" , 114 : "F3" , 115 : "F4" , 116 : "F5" , 117 : "F6" , 118 : "F7" , 119 : "F8" , 120 : "F9" , 121 : "F10" , 122 : "F11" , 123 : "F12", 144 : "NUMLOCK" , 145 : "SCROLLLOCK" , 186 : ";" , 187 : "=" , 188 : "," , 189 : "-" , 190 : "." , 191 : "/" , 192 : "`" , 219 : "[" , 220 : "\\" , 221 : "]" , 222 : "'"\r
440         },\r
441         isControl: function (e) {\r
442             var k = e.keyCode;\r
443             switch (k) {\r
444             case this.KEY.COMMAND:\r
445             case this.KEY.SHIFT:\r
446             case this.KEY.CTRL:\r
447             case this.KEY.ALT:\r
448                 return true;\r
449             default:;\r
450             }\r
451 \r
452             if (e.metaKey) {\r
453                 return true;\r
454             }\r
455 \r
456             return false;\r
457         },\r
458         isFunctionKey: function (k) {\r
459             k = k.keyCode ? k.keyCode : k;\r
460             return k >= 112 && k <= 123;\r
461         },\r
462         isVerticalMovement: function (k){\r
463           return ~[this.KEY.UP, this.KEY.DOWN].indexOf(k);\r
464         },\r
465         isHorizontalMovement: function (k){\r
466           return ~[this.KEY.LEFT, this.KEY.RIGHT, this.KEY.BACKSPACE, this.KEY.DELETE].indexOf(k);\r
467         },\r
468         isAllowedKey: function (k){\r
469           return (~[this.KEY.SPACE, this.KEY.ESC, this.KEY.ENTER].indexOf(k)) || this.isHorizontalMovement(k) || this.isVerticalMovement(k);\r
470         }\r
471     };\r
472 })\r
473 \r
474 .factory('keyMapAc', function(){\r
475     return {\r
476             keys:{ "32":" ", "33":"!", "34":"\"", "35":"#", "36":"$", "37":"%", "38":"&", "39":"'"\r
477                 , "40":"(", "41":")", "42":"*", "43":"+", "44":",", "45":"-", "46":".", "47":"\/", "58":":"\r
478                 , "59":";", "60":"<", "61":"=", "62":">", "63":"?", "64":"@", "91":"[", "92":"\\", "93":"]"\r
479                 , "94":"^", "95":"_", "96":"`", "123":"{", "124":"|", "125":"}", "126":"~"\r
480             },\r
481             keyRange:{"startNum":"48","endNum":"57","startSmallLetters":"97","endSmallLetters":"122"\r
482                 ,"startCapitalLetters":"65","endCapitalLetters":"90"},\r
483             allowedKeys:{TAB:8, BACKSPACE:9, DELETE:16}\r
484         };\r
485 })\r
486 \r
487 .factory('$attElementDetach', function () {\r
488     var _detach = function (element) {\r
489         if (element && element.parentNode) {\r
490             element.parentNode.removeChild(element);\r
491         }\r
492     };\r
493     return _detach;\r
494 })\r
495 \r
496 .factory('$ieVersion', function () {\r
497         var ie = null;\r
498         \r
499         var loadIEVersion = function () {\r
500                 var isIE10 = (eval("/*@cc_on!@*/false") && document.documentMode === 10);\r
501                 if (isIE10) {\r
502                         return 10;\r
503                 }\r
504                 var v = 3,\r
505                         div = document.createElement('div'),\r
506                         all = div.getElementsByTagName('i');\r
507                 do {\r
508                         div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->';\r
509                 } while (all[0]);\r
510                 return v > 4 ? v : undefined;\r
511         };\r
512         \r
513         return function () {\r
514                 if (ie===null) {\r
515                         ie = loadIEVersion();\r
516                 }\r
517                 return ie;\r
518         };\r
519 });\r
520 (function () {\r
521     String.prototype.toSnakeCase = function () {\r
522         return this.replace(/([A-Z])/g, function ($1) {\r
523             return "-" + $1.toLowerCase();\r
524         });\r
525     };\r
526     var concat = function (character, times) {\r
527         character = character || '';\r
528         times = (!isNaN(times) && times) || 0;\r
529         var finalChar = '';\r
530         for (var i = 0; i < times; i++) {\r
531             finalChar += character;\r
532         }\r
533         return finalChar;\r
534     };\r
535 \r
536     // direction: true for left and false for right\r
537     var pad = function (actualString, width, character, direction) {\r
538         actualString = actualString || '';\r
539         width = (!isNaN(width) && width) || 0;\r
540         character = character || '';\r
541         if (width > actualString.length) {\r
542             if (direction) {\r
543                 return concat(character, (width - actualString.length)) + actualString;\r
544             } else {\r
545                 return actualString + concat(character, (width - actualString.length));\r
546             }\r
547         }\r
548         return actualString;\r
549     };\r
550 \r
551     String.prototype.lPad = function (width, character) {\r
552         return pad(this, width, character, true);\r
553     };\r
554 \r
555     String.prototype.rPad = function (width, character) {\r
556         return pad(this, width, character, false);\r
557     };\r
558 \r
559     if (!Array.prototype.indexOf) {\r
560         Array.prototype.indexOf = function (val) {\r
561             for (var index = 0; index < this.length; index++) {\r
562                 if (this[index] === val) {\r
563                     return index;\r
564                 }\r
565             }\r
566             return -1;\r
567         };\r
568     }\r
569 })();\r
570 \r
571 angular.module('att.abs.position', [])\r
572 \r
573 .factory('$position', ['$document', '$window', function ($document, $window) {\r
574     function getStyle(el, cssprop) {\r
575         if (el.currentStyle) { //IE\r
576             return el.currentStyle[cssprop];\r
577         } else if ($window.getComputedStyle) {\r
578             return $window.getComputedStyle(el)[cssprop];\r
579         }\r
580         // finally try and get inline style\r
581         return el.style[cssprop];\r
582     }\r
583 \r
584     /**\r
585      * Checks if a given element is statically positioned\r
586      * @param element - raw DOM element\r
587      */\r
588     function isStaticPositioned(element) {\r
589         return (getStyle(element, "position") || 'static') === 'static';\r
590     }\r
591 \r
592     /**\r
593      * returns the closest, non-statically positioned parentOffset of a given element\r
594      * @param element\r
595      */\r
596     var parentOffsetEl = function (element) {\r
597         var docDomEl = $document[0];\r
598         var offsetParent = element.offsetParent || docDomEl;\r
599         while (offsetParent && offsetParent !== docDomEl && isStaticPositioned(offsetParent)) {\r
600             offsetParent = offsetParent.offsetParent;\r
601         }\r
602         return offsetParent || docDomEl;\r
603     };\r
604 \r
605     return {\r
606         /**\r
607          * Provides read-only equivalent of jQuery's position function:\r
608          * http://api.jquery.com/position/\r
609          */\r
610         position: function (element) {\r
611             var elBCR = this.offset(element);\r
612             var offsetParentBCR = {\r
613                 top: 0,\r
614                 left: 0\r
615             };\r
616             var offsetParentEl = parentOffsetEl(element[0]);\r
617             if (offsetParentEl !== $document[0]) {\r
618                 offsetParentBCR = this.offset(angular.element(offsetParentEl));\r
619                 offsetParentBCR.top += offsetParentEl.clientTop - offsetParentEl.scrollTop;\r
620                 offsetParentBCR.left += offsetParentEl.clientLeft - offsetParentEl.scrollLeft;\r
621             }\r
622 \r
623             return {\r
624                 width: element.prop('offsetWidth'),\r
625                 height: element.prop('offsetHeight'),\r
626                 top: elBCR.top - offsetParentBCR.top,\r
627                 left: elBCR.left - offsetParentBCR.left\r
628             };\r
629         },\r
630 \r
631         /**\r
632          * Provides read-only equivalent of jQuery's offset function:\r
633          * http://api.jquery.com/offset/\r
634          */\r
635         offset: function (element) {\r
636             var boundingClientRect = element[0].getBoundingClientRect();\r
637             return {\r
638                 width: element.prop('offsetWidth'),\r
639                 height: element.prop('offsetHeight'),\r
640                 top: boundingClientRect.top + ($window.pageYOffset || $document[0].body.scrollTop || $document[0].documentElement.scrollTop),\r
641                 left: boundingClientRect.left + ($window.pageXOffset || $document[0].body.scrollLeft || $document[0].documentElement.scrollLeft)\r
642             };\r
643         }\r
644     };\r
645 }])\r
646 \r
647 .factory('$isElement', [function () {\r
648     var isElement = function (currentElem, targetElem, alternateElem) {\r
649         if (currentElem[0] === targetElem[0]) {\r
650             return true;\r
651         } else if (currentElem[0] === alternateElem[0]) {\r
652             return false;\r
653         } else {\r
654             return isElement((currentElem.parent()[0] && currentElem.parent()) || targetElem, targetElem, alternateElem);\r
655         }\r
656     };\r
657 \r
658     return isElement;\r
659 }])\r
660 \r
661 .directive('attPosition', ['$position', function ($position) {\r
662     return {\r
663         restrict: 'A',\r
664         link: function (scope, elem, attr) {\r
665             scope.$watchCollection(function () {\r
666                 return $position.position(elem);\r
667             }, function (value) {\r
668                 scope[attr.attPosition] = value;\r
669             });\r
670         }\r
671     };\r
672 }]);\r
673 \r
674 \r
675 angular.module('att.abs.transition', [])\r
676 \r
677 .factory('$transition', ['$q', '$timeout', '$rootScope', function($q, $timeout, $rootScope) {\r
678 \r
679   var $transition = function(element, trigger, options) {\r
680     options = options || {};\r
681     var deferred = $q.defer();\r
682     var endEventName = $transition[options.animation ? "animationEndEventName" : "transitionEndEventName"];\r
683 \r
684     var transitionEndHandler = function() {\r
685       $rootScope.$apply(function() {\r
686         element.unbind(endEventName, transitionEndHandler);\r
687         deferred.resolve(element);\r
688       });\r
689     };\r
690 \r
691     if (endEventName) {\r
692       element.bind(endEventName, transitionEndHandler);\r
693     }\r
694 \r
695     // Wrap in a timeout to allow the browser time to update the DOM before the transition is to occur\r
696     $timeout(function() {\r
697       if ( angular.isString(trigger) ) {\r
698         element.addClass(trigger);\r
699       } else if ( angular.isFunction(trigger) ) {\r
700         trigger(element);\r
701       } else if ( angular.isObject(trigger) ) {\r
702         element.css(trigger);\r
703       }\r
704       //If browser does not support transitions, instantly resolve\r
705       if ( !endEventName ) {\r
706         deferred.resolve(element);\r
707       }\r
708     }, 100);\r
709 \r
710     // Add our custom cancel function to the promise that is returned\r
711     // We can call this if we are about to run a new transition, which we know will prevent this transition from ending,\r
712     // i.e. it will therefore never raise a transitionEnd event for that transition\r
713     deferred.promise.cancel = function() {\r
714       if ( endEventName ) {\r
715         element.unbind(endEventName, transitionEndHandler);\r
716       }\r
717       deferred.reject('Transition cancelled');\r
718     };\r
719 \r
720     return deferred.promise;\r
721   };\r
722 \r
723   // Work out the name of the transitionEnd event\r
724   var transElement = document.createElement('trans');\r
725   var transitionEndEventNames = {\r
726     'WebkitTransition': 'webkitTransitionEnd',\r
727     'MozTransition': 'transitionend',\r
728     'OTransition': 'oTransitionEnd',\r
729     'transition': 'transitionend'\r
730   };\r
731   var animationEndEventNames = {\r
732     'WebkitTransition': 'webkitAnimationEnd',\r
733     'MozTransition': 'animationend',\r
734     'OTransition': 'oAnimationEnd',\r
735     'transition': 'animationend'\r
736   };\r
737   function findEndEventName(endEventNames) {\r
738     for (var name in endEventNames){\r
739       if (transElement.style[name] !== undefined) {\r
740         return endEventNames[name];\r
741       }\r
742     }\r
743   }\r
744   $transition.transitionEndEventName = findEndEventName(transitionEndEventNames);\r
745   $transition.animationEndEventName = findEndEventName(animationEndEventNames);\r
746   return $transition;\r
747 }])\r
748 \r
749 .factory('$scrollTo', ['$window', function($window) {\r
750     var $scrollTo = function(offsetLeft, offsetTop, duration) {\r
751         TweenMax.to($window, duration || 1, {scrollTo: {y: offsetTop, x: offsetLeft}, ease: Power4.easeOut});\r
752     };\r
753     return $scrollTo;\r
754 }])\r
755 .factory('animation', function(){\r
756     return TweenMax;\r
757 })\r
758 .factory('$progressBar', function(){\r
759 \r
760    //Provides a function to pass in code for closure purposes\r
761    var loadingAnimationCreator = function(onUpdateCallback){\r
762 \r
763       //Use closure to setup some resuable code\r
764       var loadingAnimation = function(callback, duration){\r
765           TweenMax.to({}, duration, {\r
766               onUpdateParams: ["{self}"],\r
767               onUpdate: onUpdateCallback,\r
768               onComplete: callback\r
769           });\r
770       };\r
771       //Returns a function that takes a callback function and a duration for the animation\r
772       return (function(){\r
773         return loadingAnimation;\r
774       })();\r
775     };\r
776 \r
777   return loadingAnimationCreator;\r
778 })\r
779 .factory('$height', function(){\r
780   var heightAnimation = function(element,duration,height,alpha){\r
781     TweenMax.to(element,\r
782       duration,\r
783       {height:height, autoAlpha:alpha},\r
784       0);\r
785   };\r
786   return heightAnimation;\r
787 });\r
788 angular.module('att.abs.accordion', ['att.abs.utilities', 'att.abs.position', 'att.abs.transition'])\r
789 .constant('accordionConfig', {\r
790     closeOthers: false\r
791 }).controller('AccordionController', ['$scope', '$attrs', 'accordionConfig', '$log',\r
792 function ($scope, $attrs, accordionConfig, $log) {\r
793 // This array keeps track of the accordion groups\r
794 this.groups = [];\r
795 this.index = -1;\r
796 // Keep reference to user's scope to properly assign `is-open`\r
797 this.scope = $scope;\r
798 $scope.forceExpand = false;\r
799 // Ensure that all the groups in this accordion are closed, unless close-others explicitly says not to\r
800 this.closeOthers = function (openGroup) {\r
801     var closeOthers = angular.isDefined($attrs.closeOthers) ? $scope.$eval($attrs.closeOthers) : accordionConfig.closeOthers;\r
802     if (closeOthers && !$scope.forceExpand) {\r
803         angular.forEach(this.groups, function (group) {\r
804             if (group !== openGroup) {\r
805                 group.isOpen = false;\r
806             }\r
807         });\r
808     }\r
809     if (this.groups.indexOf(openGroup) === (this.groups.length - 1) && $scope.forceExpand) {\r
810         $scope.forceExpand = false;\r
811     }\r
812 };\r
813 this.expandAll = function () {\r
814     $scope.forceExpand = true;\r
815     angular.forEach(this.groups, function (group) {\r
816         group.isOpen = true;\r
817     });\r
818 };\r
819 this.collapseAll = function () {\r
820     angular.forEach(this.groups, function (group) {\r
821         group.isOpen = false;\r
822     });\r
823 };\r
824 /**function focus @param focusGroup */\r
825 this.focus = function (focusGroup) {\r
826     var self = this;\r
827     angular.forEach(this.groups, function (group, index) {\r
828         if (group !== focusGroup) {\r
829             group.focused = false;\r
830         } else {\r
831             self.index = index;\r
832             group.focused = true;\r
833         }\r
834     });\r
835 };\r
836 /** @param blurGroup*/\r
837 this.blur = function (blurGroup) {\r
838     blurGroup.focused = false;\r
839     this.index = -1;\r
840     $log.log("accordion.blur()", blurGroup);\r
841 };\r
842 /** @param group - the group in current focus @param down - cycling down */\r
843 this.cycle = function (group, down, noRecycle) {\r
844     if (!down) {\r
845         if (this.index <= 0 && !noRecycle) {\r
846             this.index = this.groups.length - 1;\r
847         } else {\r
848             this.index--;\r
849         }\r
850     } else {\r
851         if (this.index === (this.groups.length - 1))\r
852         {\r
853             if (noRecycle) {\r
854                 this.index = 0;\r
855                 group.focused = false;\r
856                 $scope.$apply();\r
857                 return;\r
858             }\r
859             else\r
860             {\r
861                 this.index = 0;\r
862             }\r
863         } else {\r
864             this.index++;\r
865         }\r
866     }\r
867 \r
868     group.focused = false;\r
869     this.groups[this.index].setFocus = true;\r
870     this.groups[this.index].focused = true;\r
871     $scope.$apply();\r
872 };\r
873 // This is called from the accordion-group directive to add itself to the accordion\r
874 this.addGroup = function (groupScope) {\r
875     var that = this;\r
876     groupScope.index = this.groups.length;\r
877     groupScope.focused = false;\r
878     this.groups.push(groupScope);\r
879 \r
880     if(this.groups.length > 0){\r
881         this.index = 0;\r
882     }\r
883 \r
884     groupScope.$on('$destroy', function () {\r
885         that.removeGroup(groupScope);\r
886     });\r
887 };\r
888 // This is called from the accordion-group directive when to remove itself\r
889 this.removeGroup = function (group) {\r
890     var index = this.groups.indexOf(group);\r
891     if (index !== -1) {\r
892         this.groups.splice(this.groups.indexOf(group), 1);\r
893     }\r
894 };\r
895 }])\r
896 //The accordion directive simply sets up the directive controller and adds an accordion CSS class to itself element.\r
897 .directive('accordion', function () {\r
898     return {\r
899         restrict: 'EA',\r
900         controller: 'AccordionController',\r
901         transclude: true,\r
902         replace: false,\r
903         scope: {\r
904             cClass: '@css',\r
905             expandAll: "=?",\r
906             collapseAll: "=?"\r
907         },\r
908         template: '<div class="{{cClass}}" ng-transclude></div>',\r
909         link: function (scope, elem, attribute, ctrl) {\r
910             scope.$watch("expandAll", function (value) {\r
911                 if (value) {\r
912                     ctrl.expandAll();\r
913                     scope.expandAll = false;\r
914                 }\r
915             });\r
916             scope.$watch("collapseAll", function (value) {\r
917                 if (value) {\r
918                     ctrl.collapseAll();\r
919                     scope.collapseAll = false;\r
920                 }\r
921             });\r
922         }\r
923     };\r
924 })\r
925 //The accordion-group directive indicates a block of html that will expand and collapse in an accordion\r
926 .directive('accordionGroup', [ function () {\r
927         return {\r
928             // We need this directive to be inside an accordion\r
929             require: ['^accordion', 'accordionGroup'],\r
930             restrict: 'EA',\r
931             // It transcludes the contents of the directive into the template\r
932             transclude: true,\r
933             // The element containing the directive will be replaced with the template\r
934             replace: true,\r
935             templateUrl: 'app/scripts/ng_js_att_tpls/accordion/accordion.html',\r
936             scope: {\r
937                 // Create an isolated scope and interpolate the heading attribute onto this scope\r
938                 heading: '@',\r
939                 isOpen: '=?'\r
940             },\r
941             controller: ['$scope', function ($scope)\r
942                 {\r
943                     $scope.showicon = true;\r
944                     this.setHeading = function (element)\r
945                     {\r
946                         this.heading = element;\r
947                         $scope.showicon = false;\r
948                     };\r
949                     this.isIsOpen = function ()\r
950                     {\r
951                         return $scope.isOpen;\r
952                     };\r
953                 }],\r
954             link: function (scope, element, attrs, ctrl) {\r
955                 var accordionCtrl = ctrl[0];\r
956                 var accordionGroupCtrl = ctrl[1];\r
957                 var keys = {tab: 9, enter: 13, esc: 27, space: 32, pageup: 33, pagedown: 34, end: 35, home: 36, left: 37, up: 38, right: 39, down: 40};\r
958                 //not a fix\r
959                 var tab = element.children().eq(0);\r
960                 var parentHyperLink=attrs.parentLink;\r
961                 scope.setFocus = false;\r
962                 scope.childLength = attrs.childLength;\r
963                 scope.headingIconClass = attrs.imageSource;\r
964 \r
965                 var handleKeydown = function (ev) {\r
966                     var boolFlag = true;\r
967                     switch (ev.keyCode)\r
968                     {\r
969                         case keys.enter:\r
970                             ev.preventDefault();\r
971                             scope.toggle();\r
972                             scope.$apply();\r
973                             break;\r
974                         case keys.up:\r
975                         case keys.left:\r
976                             ev.preventDefault();\r
977                             accordionCtrl.cycle(scope, false);\r
978                             break;\r
979                         case keys.down:\r
980                         case keys.right:\r
981                             ev.preventDefault();\r
982                             accordionCtrl.cycle(scope, true);\r
983                             break;\r
984                         default:\r
985                             boolFlag = false;\r
986                             break;\r
987                     }\r
988                     ev.stopPropagation();\r
989                     return boolFlag;\r
990                 };\r
991 \r
992                 if (angular.isUndefined(scope.isOpen)) {\r
993                     scope.isOpen = false;\r
994                 }\r
995 \r
996                 tab.bind("keydown", handleKeydown);\r
997 \r
998                 accordionCtrl.addGroup(scope);\r
999 \r
1000                 if (scope.index === 0) {\r
1001                     scope.focused = true;\r
1002                 }\r
1003 \r
1004                 accordionGroupCtrl.toggle = scope.toggle = function () {\r
1005                         /* if the menu item has children, toggle/expand child menu of this item */\r
1006                         if (scope.childLength>0) {\r
1007                         scope.isOpen = !scope.isOpen;\r
1008                         accordionCtrl.focus(scope);\r
1009                         return scope.isOpen;\r
1010                         }\r
1011                         /* if the menu item does not have children, redirect to parent action URL*/\r
1012                         else {\r
1013                                 window.location.href = parentHyperLink;\r
1014                         }\r
1015                         \r
1016                 };\r
1017 \r
1018                 scope.$watch('isOpen', function (value) {\r
1019                     if (value) {\r
1020                         accordionCtrl.closeOthers(scope);\r
1021                     }\r
1022                 });\r
1023 \r
1024                 scope.$watch("focused", function (value) {\r
1025                     if (!!value) {\r
1026                         tab.attr("tabindex", "0");\r
1027                         if(scope.setFocus){\r
1028                             tab[0].focus();\r
1029                         }\r
1030                     }\r
1031                     else{\r
1032                         scope.setFocus = false;\r
1033                         tab.attr("tabindex", "-1");\r
1034                     }\r
1035                 });\r
1036             }\r
1037         };\r
1038     }])\r
1039 //Use accordion-heading below an accordion-group to provide a heading containing HTML\r
1040 //<accordion-group>\r
1041 //<accordion-heading>Heading containing HTML - <img src="..."></accordion-heading>\r
1042 //</accordion-group>\r
1043 .directive('accordionToggle', function () {\r
1044     return{\r
1045         restrict: 'EA',\r
1046         require: '^accordionGroup',\r
1047         scope: {\r
1048             expandIcon: '@',\r
1049             collapseIcon: '@'\r
1050         },\r
1051         link: function (scope, element, attr, accordionCtrl)\r
1052         {\r
1053             var setIcon = function (isOpen) {\r
1054                 if (scope.expandIcon && scope.collapseIcon)\r
1055                 {\r
1056                     if (isOpen) {\r
1057                         element.removeClass(scope.expandIcon);\r
1058                         element.addClass(scope.collapseIcon);\r
1059                     }\r
1060                     else {\r
1061                         element.removeClass(scope.collapseIcon);\r
1062                         element.addClass(scope.expandIcon);\r
1063                     }\r
1064                 }\r
1065             };\r
1066             element.bind('click', function ()\r
1067             {\r
1068                 accordionCtrl.toggle();\r
1069                 scope.$apply();\r
1070             });\r
1071             scope.$watch(function () {\r
1072                 return accordionCtrl.isIsOpen();\r
1073             }, function (value) {\r
1074                 setIcon(value);\r
1075             });\r
1076         }\r
1077     };\r
1078 }).directive('accordionHeading', function () {\r
1079 return {\r
1080 restrict: 'EA',\r
1081 transclude: true,\r
1082 template: '',\r
1083 require: '^accordionGroup',\r
1084 compile: function (element, attr, transclude) {\r
1085     var link = function (scope, element, attr, accordionGroupCtrl) {\r
1086         // Pass the heading to the accordion-group controller\r
1087         // so that it can be transcluded into the right place in the template\r
1088         // [The second parameter to transclude causes the elements to be cloned so that they work in ng-repeat]\r
1089         transclude(scope, function (clone) {\r
1090             element.append(clone);\r
1091             accordionGroupCtrl.setHeading(element);\r
1092         });\r
1093     };\r
1094     return link;\r
1095 }\r
1096 };\r
1097 })\r
1098 // Use in the accordion-group template to indicate where you want the heading to be transcluded\r
1099 // You must provide the property on the accordion-group controller that will hold the transcluded element\r
1100         .directive('accordionTransclude', function () {\r
1101             return {\r
1102                 require: '^accordionGroup',\r
1103                 link: function (scope, element, attr, controller) {\r
1104                     scope.$watch(function () {\r
1105                         return controller[attr.accordionTransclude];\r
1106                     }, function (heading) {\r
1107                         if (heading) {\r
1108                             element.find("span").eq(0).prepend(heading);\r
1109                         }\r
1110                     });\r
1111                 }\r
1112             };\r
1113         })\r
1114         .directive('attGoTop', ['$scrollTo', function ($scrollTo) {\r
1115                 return {\r
1116                     restrict: 'A',\r
1117                     transclude: false,\r
1118                     link: function (scope, elem, attrs)\r
1119                     {\r
1120                         elem.bind('click', function ()\r
1121                         {\r
1122                             $scrollTo(0, attrs["attGoTop"]);\r
1123                         });\r
1124                     }\r
1125                 };\r
1126             }])\r
1127         .directive('attGoTo', ['$anchorScroll', '$location', function ($anchorScroll, $location) {\r
1128                 return {\r
1129                     restrict: 'A',\r
1130                     transclude: false,\r
1131                     link: function (scope, elem, attrs)\r
1132                     {\r
1133                         elem.bind('click', function ()\r
1134                         {\r
1135                             var newHash = attrs["attGoTo"];\r
1136                             if ($location.hash() !== newHash)\r
1137                             {\r
1138                                 $location.hash(attrs["attGoTo"]);\r
1139                             }\r
1140                             else\r
1141                             {\r
1142                                 $anchorScroll();\r
1143                             }\r
1144                         });\r
1145                     }\r
1146                 };\r
1147             }])\r
1148         .directive('freeStanding', function () {\r
1149             return {\r
1150                 restrict: 'EA',\r
1151                 transclude: true,\r
1152                 replace: true,\r
1153                 scope: true,\r
1154                 template: "<div><span class='att-accordion__freestanding' ng-show='showAccordion'></span>\n" +\r
1155                         "<div class='section-toggle'>\n" +\r
1156                         "<button class='section-toggle__button' ng-click='fsToggle()'>\n" +\r
1157                         "    {{btnText}}<i style='font-size:0.875rem' ng-class='{\"icon-chevron-up\": showAccordion,\"icon-chevron-down\": !showAccordion, }'></i> \n" +\r
1158                         "</button>\n" +\r
1159                         "</div></div>",\r
1160                 compile: function (element, attr, transclude)\r
1161                 {\r
1162                     var link = function (scope, elem, attrs) {\r
1163                         scope.content = "";\r
1164                         transclude(scope, function (clone)\r
1165                         {\r
1166                             elem.find("span").append(clone);\r
1167                         });\r
1168                         scope.showAccordion = false;\r
1169                         scope.btnText = scope.showAccordion ? attrs.hideMsg : attrs.showMsg;\r
1170                         scope.fsToggle = function ()\r
1171                         {\r
1172                             scope.showAccordion = !scope.showAccordion;\r
1173                             scope.btnText = scope.showAccordion ? attrs.hideMsg : attrs.showMsg;\r
1174                         };\r
1175                     };\r
1176                     return link;\r
1177                 }\r
1178             };\r
1179         }).directive('expanders', function () {\r
1180     return{\r
1181         restrict: 'EA',\r
1182         replace: true,\r
1183         transclude: true,\r
1184         template: "<div ng-transclude></div>",\r
1185         controller: ['$scope', function ($scope){\r
1186                 var bodyScope = null;\r
1187                 this.setScope = function (scope) {\r
1188                     bodyScope = scope;\r
1189                 };\r
1190                 this.toggle = function () {\r
1191                     $scope.isOpen = bodyScope.isOpen = !bodyScope.isOpen;\r
1192                     return bodyScope.isOpen;\r
1193                 };\r
1194             }],\r
1195         link: function (scope)\r
1196         {\r
1197             scope.isOpen = false;\r
1198         }\r
1199     };\r
1200 }).directive('expanderHeading', function () {\r
1201     return{\r
1202         require: "^expanders",\r
1203         restrict: 'EA',\r
1204         replace: true,\r
1205         transclude: true,\r
1206         scope: true,\r
1207         template: "<div style='padding:10px !important' ng-transclude></div>"\r
1208     };\r
1209 }).directive('expanderBody', function () {\r
1210     return{\r
1211         restrict: 'EA',\r
1212         require: "^expanders",\r
1213         replace: true,\r
1214         transclude: true,\r
1215         scope: {},\r
1216         template: "<div collapse='!isOpen'><div ng-transclude></div></div>",\r
1217         link: function (scope, elem, attr, myCtrl) {\r
1218             scope.isOpen = false;\r
1219             myCtrl.setScope(scope);\r
1220         }\r
1221     };\r
1222 }).directive('expanderToggle', function () {\r
1223     return{\r
1224         restrict: 'EA',\r
1225         require: "^expanders",\r
1226         scope: {\r
1227             expandIcon: '@',\r
1228             collapseIcon: '@'\r
1229         },\r
1230         link: function (scope, element, attr, myCtrl)\r
1231         {\r
1232             var isOpen = false;\r
1233             var setIcon = function () {\r
1234                 if (scope.expandIcon && scope.collapseIcon)\r
1235                 {\r
1236                     if (isOpen) {\r
1237                         element.removeClass(scope.expandIcon);\r
1238                         element.addClass(scope.collapseIcon);\r
1239                     }\r
1240                     else {\r
1241                         element.removeClass(scope.collapseIcon);\r
1242                         element.addClass(scope.expandIcon);\r
1243                     }\r
1244                 }\r
1245             };\r
1246             element.bind("keydown", function (e) {\r
1247                 if (e.keyCode === 13)\r
1248                 {\r
1249                     scope.toggleit();\r
1250                 }\r
1251             });\r
1252             element.bind('click', function ()\r
1253             {\r
1254                 scope.toggleit();\r
1255             });\r
1256             scope.toggleit = function ()\r
1257             {\r
1258                 isOpen = myCtrl.toggle();\r
1259                 setIcon();\r
1260                 scope.$apply();\r
1261             };\r
1262             setIcon();\r
1263         }\r
1264     };\r
1265 }).directive('collapse', ['$transition', function ($transition) {\r
1266         // CSS transitions don't work with height: auto, so we have to manually change the height to a\r
1267         // specific value and then once the animation completes, we can reset the height to auto.\r
1268         // Unfortunately if you do this while the CSS transitions are specified (i.e. in the CSS class\r
1269         // "collapse") then you trigger a change to height 0 in between.\r
1270         // The fix is to remove the "collapse" CSS class while changing the height back to auto - phew!\r
1271         var props = {\r
1272             open: {\r
1273                 marginTop: null,\r
1274                 marginBottom: null,\r
1275                 paddingTop: null,\r
1276                 paddingBottom: null,\r
1277                 display: 'block'\r
1278             },\r
1279             closed: {\r
1280                 marginTop: 0,\r
1281                 marginBottom: 0,\r
1282                 paddingTop: 0,\r
1283                 paddingBottom: 0,\r
1284                 display: 'none'\r
1285             }\r
1286         };\r
1287         var fixUpHeight = function (scope, element, height) {\r
1288             // We remove the collapse CSS class to prevent a transition when we change to height: auto\r
1289             element.removeClass('collapse');\r
1290             element.css({height: height});\r
1291             //adjusting for any margin or padding\r
1292             if (height === 0) {\r
1293                 element.css(props.closed);\r
1294             } else {\r
1295                 element.css(props.open);\r
1296             }\r
1297             // It appears that  reading offsetWidth makes the browser realise that we have changed the\r
1298             // height already :-/\r
1299             element.addClass('collapse');\r
1300         };\r
1301         return {\r
1302             link: function (scope, element, attrs) {\r
1303                 var isCollapsed;\r
1304                 var initialAnimSkip = true;\r
1305                 scope.$watch(function () {\r
1306                     return element[0].scrollHeight;\r
1307                 }, function () {\r
1308                     //The listener is called when scrollHeight changes\r
1309                     //It actually does on 2 scenarios:\r
1310                     // 1. Parent is set to display none\r
1311                     // 2. angular bindings inside are resolved\r
1312                     //When we have a change of scrollHeight we are setting again the correct height if the group is opened\r
1313                     if (element[0].scrollHeight !== 0 && !isCollapsed) {\r
1314                         if (initialAnimSkip) {\r
1315                             fixUpHeight(scope, element, element[0].scrollHeight + 'px');\r
1316                         } else {\r
1317                             fixUpHeight(scope, element, 'auto');\r
1318                         }\r
1319                     }\r
1320                 });\r
1321                 var currentTransition;\r
1322                 var doTransition = function (change) {\r
1323                     if (currentTransition) {\r
1324                         currentTransition.cancel();\r
1325                     }\r
1326                     currentTransition = $transition(element, change);\r
1327                     currentTransition.then(\r
1328                             function () {\r
1329                                 currentTransition = undefined;\r
1330                             },\r
1331                             function () {\r
1332                                 currentTransition = undefined;\r
1333                             }\r
1334                     );\r
1335                     return currentTransition;\r
1336                 };\r
1337                 var expand = function () {\r
1338                     scope.postTransition = true;\r
1339                     if (initialAnimSkip) {\r
1340                         initialAnimSkip = false;\r
1341                         if (!isCollapsed) {\r
1342                             fixUpHeight(scope, element, 'auto');\r
1343                         }\r
1344                     } else {\r
1345                         doTransition(angular.extend({height: element[0].scrollHeight + 'px'}, props.open))\r
1346                                 .then(function () {\r
1347                                     // This check ensures that we don't accidentally update the height if the user has closed\r
1348                                     // the group while the animation was still running\r
1349                                     if (!isCollapsed)\r
1350                                     {\r
1351                                         fixUpHeight(scope, element, 'auto');\r
1352                                     }\r
1353                                 });\r
1354                     }\r
1355                     isCollapsed = false;\r
1356                 };\r
1357                 var collapse = function () {\r
1358                     isCollapsed = true;\r
1359                     if (initialAnimSkip) {\r
1360                         initialAnimSkip = false;\r
1361                         fixUpHeight(scope, element, 0);\r
1362                     } else {\r
1363                         fixUpHeight(scope, element, element[0].scrollHeight + 'px');\r
1364                         doTransition(angular.extend({height: 0}, props.closed)).then(function () {\r
1365                             scope.postTransition = false;\r
1366                         });\r
1367                     }\r
1368                 };\r
1369                 scope.$watch(attrs.collapse, function (value) {\r
1370                     if (value) {\r
1371                         collapse();\r
1372                     } else {\r
1373                         expand();\r
1374                     }\r
1375                 });\r
1376             }\r
1377         };\r
1378     }])\r
1379         .directive('attAccord', function () {\r
1380             return {\r
1381                 restrict: 'EA',\r
1382                 transclude: true,\r
1383                 replace: true,\r
1384                 scope: {},\r
1385                 controller: 'AttAccordCtrl',\r
1386                 templateUrl: 'app/scripts/ng_js_att_tpls/accordion/attAccordHeader.html'\r
1387             };\r
1388         })\r
1389         .controller('AttAccordCtrl', [function () {\r
1390                 this.type = 'attAccord';\r
1391                 this.headerCtrl;\r
1392                 this.bodyCtrl;\r
1393                 var isOpen = true;\r
1394                 this.toggleBody = function () {\r
1395                     if (isOpen) {\r
1396                         this.expandBody();\r
1397                     }\r
1398                     else {\r
1399                         this.collapseBody();\r
1400                     }\r
1401                     isOpen = !isOpen;\r
1402                 };\r
1403                 this.expandBody = function () {\r
1404                     this.bodyCtrl.expand();\r
1405                 };\r
1406                 this.collapseBody = function () {\r
1407                     this.bodyCtrl.collapse();\r
1408                 };\r
1409             }])\r
1410         .controller('AttAccordHeaderCtrl', [function () {\r
1411                 this.type = 'header';\r
1412             }])\r
1413         .directive('attAccordHeader', ['keymap', 'events', function (keymap, events) {\r
1414             return {\r
1415                 restrict: 'EA',\r
1416                 transclude: true,\r
1417                 replace: true,\r
1418                 require: ['^attAccord', 'attAccordHeader'],\r
1419                 controller: 'AttAccordHeaderCtrl',\r
1420                 templateUrl: 'app/scripts/ng_js_att_tpls/accordion/attAccordHeader.html',\r
1421                 link: function (scope, element, attr, ctrls) {\r
1422                     var attAccordCtrl = ctrls[0];\r
1423                     var attAccordHeaderCtrl = ctrls[1];\r
1424                     attAccordCtrl.headerCtrl = attAccordHeaderCtrl;\r
1425                     var tab = element.children().eq(0);\r
1426                         \r
1427                     scope.clickFunc = function () {\r
1428                         attAccordCtrl.toggleBody();\r
1429                     };\r
1430 \r
1431                     var handleKeydown = function (ev) {\r
1432                         var boolFlag = true;\r
1433                         switch (ev.keyCode)\r
1434                         {\r
1435                             case keymap.KEY.ENTER:\r
1436                                 ev.preventDefault();\r
1437                                 scope.clickFunc();\r
1438                                 scope.$apply();\r
1439                                 break;\r
1440                             default:\r
1441                                 boolFlag = false;\r
1442                                 break;\r
1443                         }\r
1444                         ev.stopPropagation();\r
1445                         return boolFlag;\r
1446                     };\r
1447                         \r
1448                     if (angular.isUndefined(scope.isOpen)) {\r
1449                         scope.isOpen = false;\r
1450                     }\r
1451 \r
1452                     tab.bind("keydown", handleKeydown);\r
1453                 }\r
1454             };\r
1455         }])\r
1456         .controller('AttAccordBodyCtrl', ['$scope', function ($scope) {\r
1457                 this.type = 'body';\r
1458                 this.expand = function () {\r
1459                     $scope.expand();\r
1460                 };\r
1461                 this.collapse = function () {\r
1462                     $scope.collapse();\r
1463                 };\r
1464             }])\r
1465         .directive('attAccordBody', ['$timeout', '$height', function ($timeout, $height) {\r
1466                 return {\r
1467                     restrict: 'EA',\r
1468                     transclude: true,\r
1469                     replace: true,\r
1470                     require: ['^attAccord', 'attAccordBody'],\r
1471                     controller: 'AttAccordBodyCtrl',\r
1472                     templateUrl: 'app/scripts/ng_js_att_tpls/accordion/attAccordBody.html',\r
1473                     link: function (scope, element, attr, ctrls) {\r
1474                         var attAccordCtrl = ctrls[0];\r
1475                         var attAccordBodyCtrl = ctrls[1];\r
1476                         attAccordCtrl.bodyCtrl = attAccordBodyCtrl;\r
1477                         var originalHeight;\r
1478                         $timeout(function () {\r
1479                             originalHeight = element[0].offsetHeight;\r
1480                             $height(element, 0, 0, 0);\r
1481                         });\r
1482                         scope.expand = function () {\r
1483                             $height(element, 0.05, originalHeight, 1);\r
1484                         };\r
1485                         scope.collapse = function () {\r
1486                             $height(element, 0.25, 0, 0);\r
1487                         };\r
1488                     }\r
1489                 };\r
1490             }]);\r
1491 angular.module('att.abs.alert', [])\r
1492 .directive('attAlert', [function()\r
1493 {\r
1494     return {\r
1495         restrict:'EA',\r
1496         replace : true,\r
1497         transclude : true,\r
1498         scope: {\r
1499             alertType : "@type",\r
1500             showTop : "@topPos",\r
1501             showAlert : "="\r
1502         },\r
1503        templateUrl : 'app/scripts/ng_js_att_tpls/alert/alert.html',\r
1504        link: function(scope)\r
1505         {\r
1506             if(scope.showTop === 'true'){\r
1507                 scope.cssStyle = {'top':'50px'};\r
1508             }\r
1509             else{\r
1510                scope.cssStyle = {'top':'0px'};\r
1511             }\r
1512            scope.close = function(){\r
1513                scope.showAlert = false;\r
1514             };\r
1515         }\r
1516     };\r
1517 }]);\r
1518 \r
1519 angular.module('att.abs.boardStrip', ['att.abs.utilities'])\r
1520 .constant('BoardStripConfig', {\r
1521     'maxVisibleBoards': 4,\r
1522     'boardsToScroll': 1,\r
1523     /* These parameters are non-configurable and remain unaltered, until there is a change in corresponding SCSS */\r
1524     'boardLength': 140,\r
1525     'boardMargin': 15\r
1526 })\r
1527 .directive('attBoard', [function() {\r
1528     return {\r
1529         restrict: 'AE',\r
1530         replace: true,\r
1531         transclude: true,\r
1532         require: '^attBoardStrip',\r
1533         scope : {\r
1534             boardIndex : '=',\r
1535             boardLabel : '='\r
1536         },\r
1537         templateUrl: 'app/scripts/ng_js_att_tpls/boardStrip/attBoard.html',\r
1538         link: function(scope, element, attrs, ctrls) {\r
1539 \r
1540             var parentCtrl = ctrls;\r
1541 \r
1542             scope.getCurrentIndex = function() {\r
1543                 return parentCtrl.getCurrentIndex();\r
1544             };\r
1545             scope.selectBoard = function(boardIndex) {\r
1546                 if (!isNaN(boardIndex)) {\r
1547                     parentCtrl.setCurrentIndex(boardIndex);\r
1548                 }\r
1549             };\r
1550             scope.isInView = function(boardIndex) {\r
1551                 return parentCtrl.isInView(boardIndex);\r
1552             };\r
1553         }\r
1554     };\r
1555 }])\r
1556 .directive('attBoardStrip', ['BoardStripConfig', '$timeout', '$ieVersion', function(BoardStripConfig, $timeout, $ieVersion) {\r
1557     return {\r
1558         restrict: 'AE',\r
1559         replace: true,\r
1560         transclude: true,\r
1561         scope: {\r
1562             currentIndex: '=selectedIndex',\r
1563             boardsMasterArray : '=',\r
1564             onAddBoard : '&?'\r
1565         },\r
1566         templateUrl: 'app/scripts/ng_js_att_tpls/boardStrip/attBoardStrip.html',\r
1567         controller: function($scope) {\r
1568             if(!angular.isDefined($scope.boardsMasterArray)){\r
1569                 $scope.boardsMasterArray = [];\r
1570             }\r
1571 \r
1572             this.rectifyMaxVisibleBoards = function() {\r
1573                 if (this.maxVisibleIndex >= $scope.boardsMasterArray.length) {\r
1574                     this.maxVisibleIndex = $scope.boardsMasterArray.length - 1;\r
1575                 }\r
1576 \r
1577                 if (this.maxVisibleIndex < 0) {\r
1578                     this.maxVisibleIndex = 0;\r
1579                 }\r
1580             };\r
1581 \r
1582             this.resetBoardStrip = function(){\r
1583                 $scope.currentIndex = 0;\r
1584 \r
1585                 this.maxVisibleIndex = BoardStripConfig.maxVisibleBoards-1;\r
1586                 this.minVisibleIndex = 0;\r
1587 \r
1588                 this.rectifyMaxVisibleBoards();\r
1589             };\r
1590 \r
1591 \r
1592             if ($scope.currentIndex > 0) {\r
1593                 var index = $scope.currentIndex;\r
1594                 this.resetBoardStrip();\r
1595                 if (index > $scope.boardsMasterArray.length) {\r
1596                     $scope.currentIndex = $scope.boardsMasterArray.length-1;\r
1597                 } else {\r
1598                     $scope.currentIndex = index;\r
1599                 }\r
1600             } else {\r
1601                 this.resetBoardStrip();\r
1602             }\r
1603             \r
1604 \r
1605             this.getCurrentIndex = function() {\r
1606                 return $scope.currentIndex;\r
1607             };\r
1608             this.setCurrentIndex = function(indx) {\r
1609                 $scope.currentIndex = indx;\r
1610             };\r
1611 \r
1612             this.isInView = function(index) {\r
1613                 return (index <= this.maxVisibleIndex && index >= this.minVisibleIndex);\r
1614             };\r
1615 \r
1616             this.getBoardsMasterArrayLength = function() {\r
1617                 return $scope.boardsMasterArray.length;\r
1618             };\r
1619         },\r
1620         link: function(scope, element, attrs, ctrl) {\r
1621                         var ieVersion = $ieVersion();\r
1622 \r
1623                         var oldTimeout;\r
1624                         var animationTimeout = 1000;\r
1625                         \r
1626                         if(ieVersion && ieVersion < 10) {\r
1627                                 animationTimeout = 0;\r
1628                         }\r
1629 \r
1630                         var getBoardViewportWidth = function (numberOfVisibleBoards) {\r
1631                                 return numberOfVisibleBoards * (BoardStripConfig.boardLength + BoardStripConfig.boardMargin);\r
1632                         };\r
1633                         if(element[0].querySelector(".board-viewport")) {\r
1634                                 angular.element(element[0].querySelector(".board-viewport")).css({"width": getBoardViewportWidth(BoardStripConfig.maxVisibleBoards) + "px"});\r
1635                         }\r
1636 \r
1637                         var getBoardstripContainerWidth = function (totalNumberOfBoards) {\r
1638                                 return totalNumberOfBoards * (BoardStripConfig.boardLength + BoardStripConfig.boardMargin);\r
1639                         };\r
1640                         if(element[0].querySelector(".boardstrip-container")) {\r
1641                                 angular.element(element[0].querySelector(".boardstrip-container")).css({"width": getBoardstripContainerWidth(ctrl.getBoardsMasterArrayLength()) + "px"});\r
1642                                 angular.element(element[0].querySelector(".boardstrip-container")).css({"left": "0px"});\r
1643                         }\r
1644 \r
1645                         var calculateAndGetBoardstripContainerAdjustment = function () {\r
1646 \r
1647                                 var calculatedAdjustmentValue;\r
1648 \r
1649                                 if(ctrl.getBoardsMasterArrayLength() <= BoardStripConfig.maxVisibleBoards) {\r
1650                                         calculatedAdjustmentValue = 0;\r
1651                                 }\r
1652                                 else{\r
1653                                         calculatedAdjustmentValue = (ctrl.minVisibleIndex * (BoardStripConfig.boardLength + BoardStripConfig.boardMargin))* -1;\r
1654                                 }\r
1655                                 \r
1656                                 return calculatedAdjustmentValue;\r
1657                         };\r
1658 \r
1659             var updateBoardsTabIndex = function(boardArray, minViewIndex, maxViewIndex) {\r
1660                 for (var i = 0; i < boardArray.length; i++) {\r
1661                     angular.element(boardArray[i]).attr('tabindex', '-1');\r
1662                 }\r
1663                 for (var i = minViewIndex; i <= maxViewIndex; i++) {\r
1664                     angular.element(boardArray[i]).attr('tabindex', '0');\r
1665                 }\r
1666             };\r
1667                         \r
1668             scope.$watchCollection('boardsMasterArray', function(newVal, oldVal){\r
1669                 if(newVal !== oldVal){\r
1670                                         /* When a board is removed */\r
1671                                         if(newVal.length < oldVal.length){\r
1672                                                 ctrl.resetBoardStrip();\r
1673                                                 $timeout(function(){\r
1674                                                         \r
1675                                                         var currentBoardArray = element[0].querySelectorAll('[att-board]');\r
1676                                                         if(currentBoardArray.length !== 0) {\r
1677 \r
1678                                                                 var oldContainerAdjustment = angular.element(element[0].querySelector(".boardstrip-container"))[0].style.left;\r
1679                                                                 var containerAdjustment = calculateAndGetBoardstripContainerAdjustment();\r
1680                                                                 if(oldContainerAdjustment !== containerAdjustment+'px') {\r
1681                                                                         angular.element(element[0].querySelector(".boardstrip-container")).css({"left": containerAdjustment + "px"});\r
1682 \r
1683                                                                         $timeout.cancel(oldTimeout);\r
1684                                                                         oldTimeout = $timeout(function(){\r
1685                                                                                 currentBoardArray[0].focus();\r
1686                                                                         }, animationTimeout);\r
1687                                                                 }\r
1688                                                                 else{\r
1689                                                                         currentBoardArray[0].focus();\r
1690                                                                 }\r
1691                                                         }\r
1692                                                         else{\r
1693                                                                 element[0].querySelector('div.boardstrip-item--add').focus();\r
1694                                                         }\r
1695                                                         \r
1696                                                         angular.element(element[0].querySelector(".boardstrip-container")).css({"width": getBoardstripContainerWidth(ctrl.getBoardsMasterArrayLength()) + "px"});\r
1697                                                 });\r
1698                                         }\r
1699                                         /* When a board is added */\r
1700                                         else {\r
1701                                                 ctrl.maxVisibleIndex = ctrl.getBoardsMasterArrayLength()-1;\r
1702                                                 ctrl.minVisibleIndex = Math.max(ctrl.maxVisibleIndex - BoardStripConfig.maxVisibleBoards + 1, 0);\r
1703 \r
1704                                                 ctrl.setCurrentIndex(ctrl.maxVisibleIndex);\r
1705 \r
1706                                                 $timeout(function(){\r
1707                                                         angular.element(element[0].querySelector(".boardstrip-container")).css({"width": getBoardstripContainerWidth(ctrl.getBoardsMasterArrayLength()) + "px"});\r
1708                                                         \r
1709                                                         var oldContainerAdjustment = angular.element(element[0].querySelector(".boardstrip-container"))[0].style.left;\r
1710                                                         var containerAdjustment = calculateAndGetBoardstripContainerAdjustment();\r
1711                                                         var currentBoardArray = element[0].querySelectorAll('[att-board]');\r
1712                                                         if(oldContainerAdjustment !== containerAdjustment+'px') {\r
1713                                                                 angular.element(element[0].querySelector(".boardstrip-container")).css({"left": containerAdjustment + "px"});\r
1714                                                                 \r
1715                                                                 $timeout.cancel(oldTimeout);\r
1716                                                                 oldTimeout = $timeout(function(){\r
1717                                                                         currentBoardArray[currentBoardArray.length-1].focus();\r
1718                                                                 }, animationTimeout);\r
1719                                                         }\r
1720                                                         else{\r
1721                                                                 currentBoardArray[currentBoardArray.length-1].focus();\r
1722                                                         }\r
1723                             /* Update tabindecies to ensure keyboard navigation behaves correctly */\r
1724                             updateBoardsTabIndex(currentBoardArray, ctrl.minVisibleIndex, ctrl.maxVisibleIndex);\r
1725                                                 });\r
1726                                         }\r
1727                 }\r
1728             });\r
1729 \r
1730             scope.nextBoard = function() {\r
1731                 ctrl.maxVisibleIndex += BoardStripConfig.boardsToScroll;\r
1732                 ctrl.rectifyMaxVisibleBoards();\r
1733                 ctrl.minVisibleIndex = ctrl.maxVisibleIndex - (BoardStripConfig.maxVisibleBoards-1);\r
1734 \r
1735                                 $timeout.cancel(oldTimeout);\r
1736                                 angular.element(element[0].querySelector(".boardstrip-container")).css({"left": calculateAndGetBoardstripContainerAdjustment() + "px"});\r
1737 \r
1738                 $timeout(function(){\r
1739                     var currentBoardArray = element[0].querySelectorAll('[att-board]');\r
1740 \r
1741                     /* Remove tabindex from non-visible boards */\r
1742                     updateBoardsTabIndex(currentBoardArray, ctrl.minVisibleIndex, ctrl.maxVisibleIndex);\r
1743 \r
1744                     if (!(scope.isNextBoard())) {\r
1745                         try {\r
1746                             currentBoardArray[currentBoardArray.length-1].focus();\r
1747                         } catch(e) {}\r
1748                     }\r
1749                 }, animationTimeout);\r
1750             };\r
1751             scope.prevBoard = function() {\r
1752 \r
1753                 ctrl.minVisibleIndex -= BoardStripConfig.boardsToScroll;\r
1754                 if (ctrl.minVisibleIndex < 0) {\r
1755                     ctrl.minVisibleIndex = 0;\r
1756                 }\r
1757 \r
1758                 ctrl.maxVisibleIndex = ctrl.minVisibleIndex + BoardStripConfig.maxVisibleBoards-1;\r
1759                 ctrl.rectifyMaxVisibleBoards();\r
1760 \r
1761                                 $timeout.cancel(oldTimeout);\r
1762                                 angular.element(element[0].querySelector(".boardstrip-container")).css({"left": calculateAndGetBoardstripContainerAdjustment() + "px"});\r
1763 \r
1764                 $timeout(function(){\r
1765                     var currentBoardArray = element[0].querySelectorAll('[att-board]');\r
1766 \r
1767                     /* Remove tabindex from non-visible boards */\r
1768                     updateBoardsTabIndex(currentBoardArray, ctrl.minVisibleIndex, ctrl.maxVisibleIndex);\r
1769 \r
1770                     if (ctrl.minVisibleIndex === 0) {\r
1771                         try {\r
1772                             element[0].querySelector('div.boardstrip-item--add').focus();\r
1773                         } catch (e) {} /* IE8 may throw exception */\r
1774                     }\r
1775                 });\r
1776             };\r
1777 \r
1778             scope.isPrevBoard = function() {\r
1779                 return (ctrl.minVisibleIndex > 0);\r
1780             };\r
1781             scope.isNextBoard = function() {\r
1782                 return (ctrl.getBoardsMasterArrayLength()-1 > ctrl.maxVisibleIndex);\r
1783             };\r
1784         }\r
1785     };\r
1786 }])\r
1787 .directive('attAddBoard', ['BoardStripConfig', '$parse', '$timeout', function(BoardStripConfig, $parse, $timeout) {\r
1788     return {\r
1789         restrict: 'AE',\r
1790         replace: true,\r
1791         require: '^attBoardStrip',\r
1792         scope : {\r
1793             onAddBoard : '&?'\r
1794         },\r
1795         templateUrl: 'app/scripts/ng_js_att_tpls/boardStrip/attAddBoard.html',\r
1796         link: function(scope, element, attrs, ctrls) {\r
1797             var parentCtrl = ctrls;\r
1798             scope.addBoard = function() {\r
1799                 if (attrs['onAddBoard'] ) {\r
1800                     scope.onAddBoard = $parse(scope.onAddBoard);\r
1801                     scope.onAddBoard();\r
1802                 }\r
1803             };\r
1804         }\r
1805     };\r
1806 }])\r
1807 .directive('attBoardNavigation', ['keymap', 'events', function(keymap, events) {\r
1808     return {\r
1809         restrict: 'AE',\r
1810         link: function(scope, elem) {\r
1811 \r
1812             var prevElem = keymap.KEY.LEFT;\r
1813             var nextElem = keymap.KEY.RIGHT;\r
1814 \r
1815             elem.bind('keydown', function (ev) {\r
1816 \r
1817                 if (!(ev.keyCode)) {\r
1818                     ev.keyCode = ev.which;\r
1819                 }\r
1820 \r
1821                 switch (ev.keyCode) {\r
1822                 case nextElem:\r
1823                     events.preventDefault(ev);\r
1824                     events.stopPropagation(ev);\r
1825 \r
1826                     if (elem[0].nextElementSibling && parseInt(angular.element(elem[0].nextElementSibling).attr('tabindex')) >= 0) {\r
1827                         angular.element(elem[0])[0].nextElementSibling.focus();\r
1828                     } else {\r
1829                         /* IE8 fix */\r
1830                         var el = angular.element(elem[0])[0];\r
1831                         do {\r
1832                             if (el.nextSibling){\r
1833                                 el = el.nextSibling;\r
1834                             }\r
1835                             else{\r
1836                                 break;\r
1837                             }\r
1838                         } while (el && el.tagName !== 'LI');\r
1839 \r
1840                         if (el.tagName && el.tagName === 'LI' && parseInt(angular.element(el).attr('tabindex')) >= 0){\r
1841                             el.focus();\r
1842                         }\r
1843                     }\r
1844 \r
1845                     break;\r
1846                 case prevElem:\r
1847                     events.preventDefault(ev);\r
1848                     events.stopPropagation(ev);\r
1849 \r
1850                     if (elem[0].previousElementSibling && parseInt(angular.element(elem[0].previousElementSibling).attr('tabindex')) >= 0) {\r
1851                         angular.element(elem[0])[0].previousElementSibling.focus();\r
1852                     } else {\r
1853                         /* IE8 fix */\r
1854                         var el1 = angular.element(elem[0])[0];\r
1855                         do {\r
1856                             if (el1.previousSibling){\r
1857                                 el1 = el1.previousSibling;\r
1858                             }\r
1859                             else{\r
1860                                 break;\r
1861                             }\r
1862                         } while (el1 && el1.tagName !== 'LI');\r
1863 \r
1864                         if (el1.tagName && el1.tagName === 'LI' && parseInt(angular.element(el).attr('tabindex')) >= 0){\r
1865                             el1.focus();\r
1866                         }\r
1867                     }\r
1868                     break;\r
1869                 default:\r
1870                     break;\r
1871                 }\r
1872             });\r
1873         }\r
1874     };\r
1875 }]);\r
1876 \r
1877 angular.module('att.abs.breadCrumbs', [])\r
1878     .constant("classConstant",{\r
1879             "defaultClass" : "breadcrumbs__link",\r
1880             "activeClass": "breadcrumbs__link--active"\r
1881         })\r
1882     .directive('attCrumb', ['classConstant', function(classConstant) {\r
1883         return {\r
1884             restrict: 'A',\r
1885             link: function(scope, elem, attr) {\r
1886                 elem.addClass(classConstant.defaultClass);\r
1887                 if(attr.attCrumb === 'active'){\r
1888                      elem.addClass(classConstant.activeClass);\r
1889                 }\r
1890                if(!elem.hasClass('last')){\r
1891                    elem.after('<i class="breadcrumbs__item"></i>');\r
1892                }\r
1893             }\r
1894         };\r
1895     }\r
1896 ]);\r
1897 angular.module('att.abs.buttons', ['att.abs.position', 'att.abs.utilities'])\r
1898         .constant('btnConfig', {\r
1899             btnClass: 'button',\r
1900             btnPrimaryClass: 'button--primary',\r
1901             btnSecondaryClass: 'button--secondary',\r
1902             btnDisabledClass: 'button--inactive',\r
1903             btnSmallClass: 'button--small'\r
1904         })\r
1905         .directive('attButton', ['btnConfig', function (btnConfig) {\r
1906                 return {\r
1907                     restrict: 'A',\r
1908                     link: function (scope, element, attrs) {\r
1909                         element.addClass(btnConfig.btnClass);\r
1910                         if (attrs.size === 'small') {\r
1911                             element.addClass(btnConfig.btnSmallClass);\r
1912                         }\r
1913                         attrs.$observe('btnType', function (value) {\r
1914                             if (value === 'primary') {\r
1915                                 element.addClass(btnConfig.btnPrimaryClass);\r
1916                                 element.removeClass(btnConfig.btnSecondaryClass);\r
1917                                 element.removeClass(btnConfig.btnDisabledClass);\r
1918                                 element.removeAttr('disabled');\r
1919                             } else if (value === 'secondary') {\r
1920                                 element.addClass(btnConfig.btnSecondaryClass);\r
1921                                 element.removeClass(btnConfig.btnPrimaryClass);\r
1922                                 element.removeClass(btnConfig.btnDisabledClass);\r
1923                                 element.removeAttr('disabled');\r
1924                             } else if (value === 'disabled') {\r
1925                                 element.addClass(btnConfig.btnDisabledClass);\r
1926                                 element.removeClass(btnConfig.btnPrimaryClass);\r
1927                                 element.removeClass(btnConfig.btnSecondaryClass);\r
1928                                 element.attr('disabled', 'disabled');\r
1929                             }\r
1930                         });\r
1931                     }\r
1932                 };\r
1933             }])\r
1934         .directive('attButtonLoader', [function () {\r
1935                 return {\r
1936                     restrict: 'A',\r
1937                     replace: false,\r
1938                     scope: {\r
1939                         size: '@'\r
1940                     },\r
1941                     template: '<div ng-class="{\'button--loading\': size === \'large\',\'button--loading__small\': size === \'small\'}"><i></i><i class="second__loader"></i><i></i></div>',\r
1942                     link: function (scope, element) {\r
1943                         element.addClass('button button--inactive');\r
1944                     }\r
1945                 };\r
1946             }])\r
1947         .directive('attButtonHero', [function () {\r
1948                 return {\r
1949                     restrict: 'A',\r
1950                     replace: false,\r
1951                     transclude: true,\r
1952                     scope: {\r
1953                         icon: '@'\r
1954                     },\r
1955                     template: '<div class="button--hero__inner"><span ng-transclude></span> <i ng-class="{\'icon-arrow-right\': icon === \'arrow-right\',\'icon-cart\': icon === \'cart\'}"></i></div>',\r
1956                     link: function (scope, element) {\r
1957                         element.addClass('button button--hero');\r
1958                         element.attr("tabindex", "0");\r
1959                     }\r
1960                 };\r
1961             }])\r
1962         .directive('attBtnDropdown', ['$document', '$timeout', '$isElement', '$documentBind', 'keymap', 'events', function ($document, $timeout, $isElement, $documentBind, keymap, events) {\r
1963                 return {\r
1964                     restrict: 'EA',\r
1965                     scope: {\r
1966                         type: "@dropdowntype"\r
1967                     },\r
1968                     replace: true,\r
1969                     transclude: true,\r
1970                     templateUrl: 'app/scripts/ng_js_att_tpls/buttons/buttonDropdown.html',\r
1971                     link: function (scope, element) {\r
1972                         scope.isOpen = false;\r
1973                         var currentIndex = -1;\r
1974                         // Capture all the li elements after compilation\r
1975                         var list = [], button = undefined;\r
1976                         $timeout(function() {\r
1977                             list = element.find('li');\r
1978                             button = element.find('button')[0];\r
1979                         }, 10);\r
1980                         var toggle = scope.toggle = function (show) {\r
1981                             if (angular.isUndefined(show) || show === '') {\r
1982                                 scope.isOpen = !scope.isOpen;\r
1983                             }\r
1984                             else {\r
1985                                 scope.isOpen = show;\r
1986                             }\r
1987                         };\r
1988                         var selectNext = function() {\r
1989                             if (currentIndex+1 < list.length) {\r
1990                                 currentIndex++;\r
1991                                 list[currentIndex].focus();\r
1992                             }\r
1993                         };\r
1994                         var selectPrev = function() {\r
1995                             if (currentIndex-1 >= 0) {\r
1996                                 currentIndex--;\r
1997                                 list[currentIndex].focus();\r
1998                             }\r
1999                         };\r
2000                         element.bind("keydown", function($event) {\r
2001                             var keyCode = $event.keyCode;\r
2002                             if (keymap.isAllowedKey(keyCode) || keymap.isControl($event) || keymap.isFunctionKey($event)) {\r
2003                                 switch (keyCode) {\r
2004                                     case keymap.KEY.ENTER:\r
2005                                         if (currentIndex > 0) {\r
2006                                             button.focus();\r
2007                                             scope.$apply();\r
2008                                         }\r
2009                                         break;\r
2010                                     case keymap.KEY.ESC:\r
2011                                         toggle(false);\r
2012                                         currentIndex = -1;\r
2013                                         button.focus();\r
2014                                         scope.$apply();\r
2015                                         break;\r
2016                                     case keymap.KEY.DOWN:\r
2017                                         selectNext();\r
2018                                         scope.$apply();\r
2019                                         events.preventDefault($event);\r
2020                                         events.stopPropagation($event);\r
2021                                         break;\r
2022                                     case keymap.KEY.UP:\r
2023                                         selectPrev();\r
2024                                         scope.$apply();\r
2025                                         events.preventDefault($event);\r
2026                                         events.stopPropagation($event);\r
2027                                         break;\r
2028                                     default:\r
2029                                         break;\r
2030                                 }\r
2031                             } else if (keyCode === keymap.KEY.TAB) {\r
2032                                 toggle(false);\r
2033                                 currentIndex = -1;\r
2034                                 scope.$apply();\r
2035                             }\r
2036                         });\r
2037                         var outsideClick = function (e) {\r
2038                             var isElement = $isElement(angular.element(e.target), element, $document);\r
2039                             if (!isElement) {\r
2040                                 toggle(false);\r
2041                                 currentIndex = -1;\r
2042                                 for (var i = 0; i < list.length; i++) {\r
2043                                     angular.element(list[i]).removeClass('selected');\r
2044                                 }\r
2045                                 button.focus();\r
2046                                 scope.$apply();\r
2047                             }\r
2048                         };\r
2049                         $documentBind.click('isOpen', outsideClick, scope);\r
2050                     }\r
2051                 };\r
2052             }]);\r
2053 angular.module('att.abs.checkbox', [])\r
2054 .constant("attCheckboxConfig", {\r
2055     activeClass : "att-checkbox--on",\r
2056     disabledClass : "att-checkbox--disabled"\r
2057 })\r
2058 .directive('checkboxLimit', function () {\r
2059 return {\r
2060     scope: {\r
2061         checkboxLimit:'=',\r
2062         selectLimit:'@?',\r
2063         maxSelected:'&?'\r
2064     },\r
2065     restrict: 'A',\r
2066     require:'checkboxLimit',\r
2067     controller: ['$scope',function($scope)\r
2068     {\r
2069         $scope.limit=true;\r
2070         this.getMaxLimits=function(){\r
2071             return $scope.limit;\r
2072         };\r
2073         this.setMaxLimits=function(value){\r
2074             $scope.limit=value;\r
2075         };\r
2076         this.maxCheckboxSelected=function(){\r
2077             $scope.maxSelected();\r
2078         };\r
2079     }],\r
2080     link: function (scope, element, attribute, ctrl) {\r
2081         scope.$watch('checkboxLimit', function()\r
2082         {\r
2083             var countTrue = 0;\r
2084             for (var keys in scope.checkboxLimit) {\r
2085                 if (scope.checkboxLimit.hasOwnProperty(keys) && scope.checkboxLimit[keys]) {\r
2086                         countTrue = countTrue + 1;\r
2087                 }\r
2088             };\r
2089             if(countTrue>=parseInt(scope.selectLimit)){\r
2090                 ctrl.setMaxLimits(false);\r
2091             }\r
2092             else{\r
2093                 ctrl.setMaxLimits(true);\r
2094             }\r
2095             }, true);\r
2096     }\r
2097 };\r
2098 })\r
2099 .directive('attCheckbox', ['$compile', "attCheckboxConfig", function ($compile, attCheckboxConfig) {\r
2100     return {\r
2101         scope: {},\r
2102         restrict: 'A',\r
2103         require: ['ngModel','^?checkboxLimit'],\r
2104         link: function (scope, element, attribute, ctrl) {\r
2105             var ngCtrl = ctrl[0];\r
2106             var checkboxLimitCtrl = ctrl[1];\r
2107             var parentDiv = $compile('<div tabindex="0" role="checkbox" att-accessibility-click="13,32" aria-label="Checkbox" ng-click="updateModel($event)" class="att-checkbox"></div>')(scope);\r
2108             element.css({display:'none'});\r
2109             element.wrap(parentDiv);\r
2110             element.parent().append('<div class="att-checkbox__indicator"></div>');\r
2111             element.parent().attr("title", attribute.title);\r
2112             element.parent().attr("aria-label", attribute.title);\r
2113             element.parent().attr("id", attribute.id);\r
2114             element.removeAttr("id");\r
2115             //element.removeAttr("title");\r
2116             //model -> UI\r
2117             ngCtrl.$render = function () {\r
2118                 var selected = ngCtrl.$modelValue ? true : false;\r
2119                 element.parent().toggleClass(attCheckboxConfig.activeClass, selected);\r
2120                 element.parent().attr("aria-checked", selected);\r
2121             };\r
2122 \r
2123             //ui->model\r
2124             scope.updateModel = function (evt) {\r
2125                 if (!scope.disabled) {\r
2126                     ngCtrl.$setViewValue(element.parent().hasClass(attCheckboxConfig.activeClass) ? false : true);\r
2127                     if(checkboxLimitCtrl && !(checkboxLimitCtrl.getMaxLimits())){\r
2128                         if(!ngCtrl.$modelValue){\r
2129                             ngCtrl.$render();\r
2130                         }\r
2131                         else{\r
2132                             checkboxLimitCtrl.maxCheckboxSelected();\r
2133                             ngCtrl.$setViewValue(element.parent().hasClass(attCheckboxConfig.activeClass) ? true : false);\r
2134                         }\r
2135                     }\r
2136                     else{\r
2137                         ngCtrl.$render();\r
2138                     }\r
2139                 }\r
2140                 evt.preventDefault();\r
2141             };\r
2142 \r
2143             attribute.$observe('disabled', function(val) {\r
2144                 scope.disabled = (val || val === "disabled" || val === "true");\r
2145                 element.parent().toggleClass(attCheckboxConfig.disabledClass, scope.disabled);\r
2146                 element.parent().attr("tabindex", scope.disabled ? "-1" : "0");\r
2147             });\r
2148         }\r
2149     };\r
2150 }])\r
2151 .directive('checkboxGroup', ['$compile',function($compile) {\r
2152     return {\r
2153         scope:{\r
2154             checkboxGroup: "=",\r
2155             checkboxGroupValue: "=?"\r
2156         },\r
2157         restrict: 'A',\r
2158         link: function(scope, element, attribute){\r
2159                 scope.checkboxState = 'none';\r
2160                 if (scope.checkboxGroupValue === undefined) {\r
2161                     scope.checkboxGroupValue = "indeterminate";\r
2162                 }\r
2163                 element.css({display:'none'});\r
2164                 element.wrap($compile('<div tabindex="0" role="checkbox" att-accessibility-click="13,32" ng-click="updateModel($event)" class="att-checkbox"></div>')(scope));\r
2165                 element.parent().append('<div class="att-checkbox__indicator"></div>');\r
2166                 element.parent().attr("title", attribute.title);\r
2167                 element.parent().attr("aria-label", attribute.title);\r
2168                 scope.$watch('checkboxState', function(val) {\r
2169                     if (val === 'all') {\r
2170                         element.parent().addClass('att-checkbox--on');\r
2171                         element.parent().removeClass('att-checkbox--indeterminate');\r
2172                         element.parent().attr("aria-checked", true);\r
2173                     }\r
2174                     else if (val === 'none') {\r
2175                         element.parent().removeClass('att-checkbox--on');\r
2176                         element.parent().removeClass('att-checkbox--indeterminate');\r
2177                         element.parent().attr("aria-checked", false);\r
2178                     }\r
2179                     else if (val === 'indeterminate') {\r
2180                         element.parent().removeClass('att-checkbox--on');\r
2181                         element.parent().addClass('att-checkbox--indeterminate');\r
2182                         element.parent().attr("aria-checked", true);\r
2183                     }\r
2184                 });\r
2185                 scope.updateModel = function(evt){\r
2186                     if (element.parent().hasClass('att-checkbox--on')) {\r
2187                             element.parent().removeClass('att-checkbox--on');\r
2188                             for (var keys in scope.checkboxGroup) {\r
2189                                 if (scope.checkboxGroup.hasOwnProperty(keys)) {\r
2190                                     scope.checkboxGroup[keys] = false;\r
2191                                 }\r
2192                             };\r
2193                             }\r
2194                     else {\r
2195                         element.parent().addClass('att-checkbox--on');\r
2196                         for (var key in scope.checkboxGroup) {\r
2197                             if (scope.checkboxGroup.hasOwnProperty(key)) {\r
2198                                 scope.checkboxGroup[key] = true;\r
2199                             }\r
2200                         };\r
2201                     }\r
2202                     evt.preventDefault();\r
2203                 };\r
2204                 scope.$watch('checkboxGroupValue', function (value) {\r
2205                     if (value===false) {\r
2206                             element.parent().removeClass('att-checkbox--on');\r
2207                             for (var keys in scope.checkboxGroup) {\r
2208                                 if (scope.checkboxGroup.hasOwnProperty(keys)) {\r
2209                                         scope.checkboxGroup[keys] = false;\r
2210                                 }\r
2211                             };\r
2212                             }\r
2213                     else if (value === true){\r
2214                         element.parent().addClass('att-checkbox--on');\r
2215                         for (var key in scope.checkboxGroup) {\r
2216                             if (scope.checkboxGroup.hasOwnProperty(key)) {\r
2217                                     scope.checkboxGroup[key] = true;\r
2218                             }\r
2219                         };\r
2220                     }\r
2221                 });\r
2222             scope.$watch('checkboxGroup', function(){\r
2223                 var countTrue = 0;\r
2224                 var countFalse = 0;\r
2225                 var count = 0;\r
2226                 for (var keys in scope.checkboxGroup) {\r
2227                     if (scope.checkboxGroup.hasOwnProperty(keys)) {\r
2228                         count = count + 1;\r
2229                         if (scope.checkboxGroup[keys]) {\r
2230                             countTrue = countTrue + 1;\r
2231                         }\r
2232                         else if (!scope.checkboxGroup[keys]) {\r
2233                             countFalse = countFalse + 1;\r
2234                         }\r
2235                     }\r
2236                 };\r
2237                 if (count === countTrue) {\r
2238                     scope.checkboxState = "all";\r
2239                      scope.checkboxGroupValue=true;\r
2240                 }\r
2241                 else if (count === countFalse) {\r
2242                     scope.checkboxState = "none";\r
2243                     scope.checkboxGroupValue=false;\r
2244                 }\r
2245                 else {\r
2246                     scope.checkboxState = "indeterminate";\r
2247                     scope.checkboxGroupValue="indeterminate";\r
2248                 }\r
2249                 }, true);\r
2250         }\r
2251     };\r
2252 }]);\r
2253 \r
2254 angular.module('att.abs.colorselector', [])\r
2255     .directive('colorSelectorWrapper', [function() {\r
2256         return {\r
2257             scope: {\r
2258                 selected: '=',\r
2259                 iconColor: '@'\r
2260                 \r
2261             },\r
2262             restrict: 'AE',\r
2263             transclude: true,\r
2264             templateUrl: 'app/scripts/ng_js_att_tpls/colorselector/colorselector.html',\r
2265             link: function(scope) {\r
2266                 scope.applycolor = {'background-color': scope.iconColor};\r
2267                 scope.selectedcolor = function(iconColor) {\r
2268                     scope.selected = iconColor;\r
2269                 };\r
2270             }\r
2271         };\r
2272      }])\r
2273     .directive('colorSelector', ['$compile', function($compile) {\r
2274         return{\r
2275             restrict: 'A',\r
2276             scope: {\r
2277                 colorSelector: '@',                \r
2278                 ngModel: '='\r
2279             },\r
2280             link: function(scope, element, attr) {\r
2281                 element.removeAttr('color-selector');\r
2282                 var colorTitle = attr.title;\r
2283                 var wrapcont = angular.element('<color-selector-wrapper selected="ngModel" title="' + colorTitle + '" icon-color="{{colorSelector}}">' + element.prop('outerHTML') + '</color-selector-wrapper>');\r
2284                 var newWrapcont = $compile(wrapcont)(scope);\r
2285                 element.replaceWith(newWrapcont);\r
2286             }\r
2287         };\r
2288     }]);\r
2289 angular.module('att.abs.datepicker', ['att.abs.position', 'att.abs.utilities'])\r
2290 \r
2291 .constant('datepickerConfig', {\r
2292     dateFormat: 'MM/dd/yyyy',\r
2293     dayFormat: 'd',\r
2294     monthFormat: 'MMMM',\r
2295     yearFormat: 'yyyy',\r
2296     dayHeaderFormat: 'EEEE',\r
2297     dayTitleFormat: 'MMMM yyyy',\r
2298     disableWeekend: false,\r
2299     disableSunday: false,\r
2300     startingDay: 0,\r
2301     minDate: null,\r
2302     maxDate: null,\r
2303     mode: 0,\r
2304     dateFilter: {\r
2305         defaultText: 'Select from list'\r
2306     },\r
2307     datepickerEvalAttributes: ['dateFormat', 'dayFormat', 'monthFormat', 'yearFormat', 'dayHeaderFormat', 'dayTitleFormat', 'disableWeekend', 'disableSunday', 'startingDay', 'mode'],\r
2308     datepickerWatchAttributes: ['min', 'max']\r
2309 })\r
2310 \r
2311 .factory('datepickerService', ['datepickerConfig', 'dateFilter', function (datepickerConfig, dateFilter) {\r
2312     var setAttributes = function (attr, elem) {\r
2313         if (angular.isDefined(attr) && attr !== null && angular.isDefined(elem) && elem !== null) {\r
2314             var attributes = datepickerConfig.datepickerEvalAttributes.concat(datepickerConfig.datepickerWatchAttributes);\r
2315             for (var key in attr) {\r
2316                 var val = attr[key];\r
2317                 if (attributes.indexOf(key) !== -1 && angular.isDefined(val)) {\r
2318                     elem.attr(key.toSnakeCase(), key);\r
2319                 }\r
2320             }\r
2321         }\r
2322     };\r
2323 \r
2324     var bindScope = function (attr, scope) {\r
2325         if (angular.isDefined(attr) && attr !== null && angular.isDefined(scope) && scope !== null) {\r
2326             var evalFunction = function (key, val) {\r
2327                 scope[key] = scope.$parent.$eval(val);\r
2328             };\r
2329 \r
2330             var watchFunction = function (key, val) {\r
2331                 scope.$parent.$watch(val, function (value) {\r
2332                     scope[key] = value;\r
2333                 });\r
2334                 scope.$watch(key, function (value) {\r
2335                     scope.$parent[val] = value;\r
2336                 });\r
2337             };\r
2338 \r
2339             var evalAttributes = datepickerConfig.datepickerEvalAttributes;\r
2340             var watchAttributes = datepickerConfig.datepickerWatchAttributes;\r
2341             for (var key in attr) {\r
2342                 var val = attr[key];\r
2343                 if (evalAttributes.indexOf(key) !== -1 && angular.isDefined(val)) {\r
2344                     evalFunction(key, val);\r
2345                 } else if (watchAttributes.indexOf(key) !== -1 && angular.isDefined(val)) {\r
2346                     watchFunction(key, val);\r
2347                 }\r
2348             }\r
2349         }\r
2350     };\r
2351 \r
2352     var validateDateString = function (dateString, dateFormat) {\r
2353         if (dateString && dateFormat) {\r
2354             var delimiter;\r
2355             if (dateFormat.indexOf('/') !== -1) {\r
2356                 delimiter = '/';\r
2357             } else if (dateFormat.indexOf('-') !== -1) {\r
2358                 delimiter = '-';\r
2359             } else if (dateFormat.indexOf('.') !== -1) {\r
2360                 delimiter = '.';\r
2361             }\r
2362 \r
2363             var dateStringArray = dateString.split(delimiter);\r
2364             var dateFormatArray = dateFormat.split(delimiter);\r
2365             if (dateStringArray.length !== dateFormatArray.length) {\r
2366                 return false;\r
2367             }\r
2368 \r
2369             for (var i = 0; i < dateStringArray.length; i++) {\r
2370                 dateStringArray[i] = dateStringArray[i].lPad(dateFormatArray[i].length, '0');\r
2371             }\r
2372             var intermediateDateString = dateStringArray.join(delimiter);\r
2373 \r
2374             var actualDateString = dateFilter(new Date(intermediateDateString), dateFormat);\r
2375             return intermediateDateString === actualDateString;\r
2376         }\r
2377     };\r
2378 \r
2379     return {\r
2380         setAttributes: setAttributes,\r
2381         bindScope: bindScope,\r
2382         validateDateString: validateDateString\r
2383     };\r
2384 }])\r
2385 \r
2386 .controller('DatepickerController', ['$scope', '$attrs', 'dateFilter', 'datepickerConfig', function($scope, $attrs, dateFilter, dtConfig) {\r
2387     var format = {\r
2388         date: getValue($attrs.dateFormat, dtConfig.dateFormat),\r
2389         day: getValue($attrs.dayFormat, dtConfig.dayFormat),\r
2390         month: getValue($attrs.monthFormat, dtConfig.monthFormat),\r
2391         year: getValue($attrs.yearFormat, dtConfig.yearFormat),\r
2392         dayHeader: getValue($attrs.dayHeaderFormat, dtConfig.dayHeaderFormat),\r
2393         dayTitle: getValue($attrs.dayTitleFormat, dtConfig.dayTitleFormat),\r
2394         disableWeekend: getValue($attrs.disableWeekend, dtConfig.disableWeekend),\r
2395         disableSunday: getValue($attrs.disableSunday, dtConfig.disableSunday)\r
2396     },\r
2397     startingDay = getValue($attrs.startingDay, dtConfig.startingDay);\r
2398     $scope.mode = getValue($attrs.mode, dtConfig.mode);\r
2399 \r
2400     $scope.minDate = dtConfig.minDate ? $scope.resetTime(dtConfig.minDate) : null;\r
2401     $scope.maxDate = dtConfig.maxDate ? $scope.resetTime(dtConfig.maxDate) : null;\r
2402 \r
2403     function getValue(value, defaultValue) {\r
2404         return angular.isDefined(value) ? $scope.$parent.$eval(value) : defaultValue;\r
2405     }\r
2406 \r
2407     function getDaysInMonth(year, month) {\r
2408         return new Date(year, month, 0).getDate();\r
2409     }\r
2410 \r
2411     function getDates(startDate, n) {\r
2412         var dates = [];\r
2413         var current = startDate, i = 0;\r
2414         while (i < n) {\r
2415             dates[i++] = new Date(current);\r
2416             current.setDate(current.getDate() + 1);\r
2417         }\r
2418         return dates;\r
2419     }\r
2420 \r
2421     var compare = this.compare = function(date1, date2) {\r
2422         return (new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()) - new Date(date2.getFullYear(), date2.getMonth(), date2.getDate()));\r
2423     };\r
2424 \r
2425     function isSelected(dt) {\r
2426         if (dt && angular.isDate($scope.currentDate) && compare(dt, $scope.currentDate) === 0) {\r
2427             return true;\r
2428         }\r
2429         return false;\r
2430     }\r
2431 \r
2432     function isFromDate(dt) {\r
2433         if (dt && angular.isDate($scope.fromDate) && compare(dt, $scope.fromDate) === 0) {\r
2434             return true;\r
2435         }\r
2436         return false;\r
2437     }\r
2438 \r
2439     function isToDate(dt) {\r
2440         if (dt && angular.isDate($scope.fromDate) && angular.isDate($scope.currentDate) && compare(dt, $scope.currentDate) === 0) {\r
2441             return true;\r
2442         }\r
2443         return false;\r
2444     }\r
2445 \r
2446     function isDateRange(dt) {\r
2447         if (dt && angular.isDate($scope.fromDate) && angular.isDate($scope.currentDate) && (compare(dt, $scope.fromDate) >= 0) && (compare(dt, $scope.currentDate) <= 0)) {\r
2448             return true;\r
2449         }\r
2450         return false;\r
2451     }\r
2452 \r
2453     function isWeekend(date) {\r
2454         if (dateFilter(date, format.dayHeader) === "Saturday" || dateFilter(date, format.dayHeader) === "Sunday") {\r
2455             return true;\r
2456         }\r
2457         return false;\r
2458     }\r
2459 \r
2460     function isToday(date) {\r
2461         if (compare(date, $scope.resetTime(new Date())) === 0) {\r
2462             return true;\r
2463         }\r
2464         return false;\r
2465     }\r
2466     function isFocused(date) {\r
2467         if (date && angular.isDate($scope.focusedDate) && compare(date, $scope.focusedDate) === 0) {\r
2468             return true;\r
2469         }\r
2470         return false;\r
2471     }\r
2472 \r
2473     var isDisabled = this.isDisabled = function(date) {\r
2474         if (format.disableWeekend === true && (dateFilter(date, format.dayHeader) === "Saturday" || dateFilter(date, format.dayHeader) === "Sunday")) {\r
2475             return true;\r
2476         }\r
2477         if (format.disableSunday === true && (dateFilter(date, format.dayHeader) === "Sunday")) {\r
2478             return true;\r
2479         }\r
2480         return (($scope.minDate && compare(date, $scope.minDate) < 0) || ($scope.maxDate && compare(date, $scope.maxDate) > 0));\r
2481     };\r
2482 \r
2483 \r
2484     function isMinDateAvailable(startDate, endDate) {\r
2485        return ($scope.minDate && $scope.minDate.getTime() >= startDate.getTime()) && ($scope.minDate.getTime() <= endDate.getTime());\r
2486     }\r
2487 \r
2488     function isMaxDateAvailable(startDate, endDate) {\r
2489         return ($scope.maxDate && $scope.maxDate.getTime() >= startDate.getTime()) && ($scope.maxDate.getTime() <= endDate.getTime());\r
2490     }\r
2491 \r
2492     function getLabel(label) {\r
2493         if (label)\r
2494         {\r
2495             var labelObj = {\r
2496                 pre: label.substr(0, 3),\r
2497                 post: label\r
2498             };\r
2499             return labelObj;\r
2500         }\r
2501         return;\r
2502     }\r
2503     function makeDate(dateobj) {\r
2504         return {date: dateobj.date, label: dateFilter(dateobj.date, dateobj.formatDay), header: dateFilter(dateobj.date, dateobj.formatHeader), focused: !!dateobj.isFocused, selected: !!dateobj.isSelected, from: !!dateobj.isFromDate, to: !!dateobj.isToDate, dateRange: !!dateobj.isDateRange, oldMonth: !!dateobj.oldMonth, nextMonth: !!dateobj.newMonth, disabled: !!dateobj.isDisabled, today: !!dateobj.isToday, weekend: !!dateobj.isWeakend};\r
2505     }\r
2506 \r
2507     this.modes = [\r
2508         {\r
2509             name: 'day',\r
2510             getVisibleDates: function(date, calendar) {\r
2511                 var year = date.getFullYear(), month = date.getMonth(), firstDayOfMonth = new Date(year, month, 1), lastDayOfMonth = new Date(year, month+1, 0);\r
2512                 var difference = startingDay - firstDayOfMonth.getDay(),\r
2513                         numDisplayedFromPreviousMonth = (difference > 0) ? 7 - difference : -difference,\r
2514                         firstDate = new Date(firstDayOfMonth), numDates = 0;\r
2515 \r
2516                 if (numDisplayedFromPreviousMonth > 0) {\r
2517                     firstDate.setDate(-numDisplayedFromPreviousMonth + 1);\r
2518                     numDates += numDisplayedFromPreviousMonth; // Previous\r
2519                 }\r
2520                 numDates += getDaysInMonth(year, month + 1); // Current\r
2521                 numDates += (7 - numDates % 7) % 7; // Next\r
2522 \r
2523                 var days = getDates(firstDate, numDates), labels = [];\r
2524                 for (var i = 0; i < numDates; i++) {\r
2525                     var dt = new Date(days[i]);\r
2526                     days[i] = makeDate({date:dt,\r
2527                                 formatDay:format.day,\r
2528                                 formatHeader:format.dayHeader,\r
2529                                 isFocused:isFocused(dt),\r
2530                                 isSelected:isSelected(dt),\r
2531                                 isFromDate:isFromDate(dt),\r
2532                                 isToDate:isToDate(dt),\r
2533                                 isDateRange:isDateRange(dt),\r
2534                                 oldMonth:(new Date(dt.getFullYear(), dt.getMonth(), 1, 0, 0, 0).getTime() < new Date(year, month, 1, 0, 0, 0).getTime()),\r
2535                                 newMonth:(new Date(dt.getFullYear(), dt.getMonth(), 1, 0, 0, 0).getTime() > new Date(year, month, 1, 0, 0, 0).getTime()),\r
2536                                 isDisabled:isDisabled(dt),\r
2537                                 isToday:isToday(dt),\r
2538                                 isWeakend:isWeekend(dt)});\r
2539                 }\r
2540                 for (var j = 0; j < 7; j++) {\r
2541                     labels[j] = getLabel(dateFilter(days[j].date, format.dayHeader));\r
2542                 }\r
2543                 if (calendar === 'top') {\r
2544                     $scope.disablePrevTop = isMinDateAvailable(firstDayOfMonth, lastDayOfMonth);\r
2545                     $scope.disableNextTop = isMaxDateAvailable(firstDayOfMonth, lastDayOfMonth);\r
2546                 } else if (calendar === 'bottom') {\r
2547                     $scope.disablePrevBottom = isMinDateAvailable(firstDayOfMonth, lastDayOfMonth);\r
2548                     $scope.disableNextBottom = isMaxDateAvailable(firstDayOfMonth, lastDayOfMonth);\r
2549                 } else {\r
2550                     $scope.disablePrevTop = $scope.disablePrevBottom = isMinDateAvailable(firstDayOfMonth, lastDayOfMonth);\r
2551                     $scope.disableNextTop = $scope.disableNextBottom = isMaxDateAvailable(firstDayOfMonth, lastDayOfMonth);\r
2552                 }\r
2553                 $scope.disablePrev = $scope.disablePrevTop || $scope.disablePrevBottom;\r
2554                 $scope.disableNext = $scope.disableNextTop || $scope.disableNextBottom;\r
2555                 return {objects: days, title: dateFilter(date, format.dayTitle), labels: labels};\r
2556             },\r
2557             split: 7,\r
2558             step: {months: 1}\r
2559         },\r
2560         {\r
2561             name: 'month',\r
2562             getVisibleDates: function(date) {\r
2563                 var months = [], labels = [], year = date.getFullYear();\r
2564                 for (var i = 0; i < 12; i++) {\r
2565                    var dt = new Date(year,i,1);\r
2566                     months[i] = makeDate({date:dt,\r
2567                                 formatDay:format.month,\r
2568                                 formatHeader:format.month,\r
2569                                 isFocused:isFocused(dt),\r
2570                                 isSelected:isSelected(dt),\r
2571                                 isFromDate:isFromDate(dt),\r
2572                                 isToDate:isToDate(dt),\r
2573                                 isDateRange:isDateRange(dt),\r
2574                                 oldMonth:false,\r
2575                                 newMonth:false,\r
2576                                 isDisabled:isDisabled(dt),\r
2577                                 isToday:isToday(dt),\r
2578                                 isWeakend:false});\r
2579                 }\r
2580                 return {objects: months, title: dateFilter(date, format.year), labels: labels};\r
2581             },\r
2582             split:3,\r
2583             step: {years: 1}\r
2584         }\r
2585     ];\r
2586 \r
2587 }])\r
2588 \r
2589 .directive('datepicker', ['$timeout', function ($timeout) {\r
2590     return {\r
2591         restrict: 'EA',\r
2592         replace: true,\r
2593         transclude: true,\r
2594         templateUrl: 'app/scripts/ng_js_att_tpls/datepicker/datepicker.html',\r
2595         scope: {\r
2596             currentDate: "=?current",\r
2597             fromDate: "=?from"\r
2598         },\r
2599         require: 'datepicker',\r
2600         controller: 'DatepickerController',\r
2601         link: function(scope, element, attrs, ctrl) {\r
2602             var datepickerCtrl = ctrl;\r
2603             var selected, calendarSelected = false;\r
2604             scope.focusedDate;\r
2605 \r
2606             scope.resetTime = function(date) {\r
2607                 var dt;\r
2608                 if (!isNaN(new Date(date))) {\r
2609                     dt = new Date(date);\r
2610                     if(scope.mode === 1){\r
2611                         dt = new Date(dt.getFullYear(), dt.getMonth());\r
2612                     }else{\r
2613                         dt = new Date(dt.getFullYear(), dt.getMonth(), dt.getDate());\r
2614                     }\r
2615                 } else {\r
2616                     return null;\r
2617                 }\r
2618                 return dt;\r
2619             };\r
2620 \r
2621             if (attrs.min) {\r
2622                 scope.$parent.$watch(attrs.min, function(value) {\r
2623                     scope.minDate = value ? scope.resetTime(value) : null;\r
2624                     refill();\r
2625                 });\r
2626             }\r
2627             if (attrs.max) {\r
2628                 scope.$parent.$watch(attrs.max, function(value) {\r
2629                     scope.maxDate = value ? scope.resetTime(value) : null;\r
2630                     refill();\r
2631                 });\r
2632             }\r
2633 \r
2634             // Split array into smaller arrays\r
2635             function split(arr, size) {\r
2636                 var arrays = [];\r
2637                 while (arr.length > 0) {\r
2638                     arrays.push(arr.splice(0, size));\r
2639                 }\r
2640                 return arrays;\r
2641             }\r
2642             var moveMonth = function(selectedDate, direction) {\r
2643                 var step = datepickerCtrl.modes[scope.mode].step;\r
2644                 selectedDate.setDate(1);\r
2645                 selectedDate.setMonth(selectedDate.getMonth() + direction * (step.months || 0));\r
2646                 selectedDate.setFullYear(selectedDate.getFullYear() + direction * (step.years || 0));\r
2647 \r
2648                 return selectedDate;\r
2649             };\r
2650 \r
2651             function refill(date) {\r
2652                 if (angular.isDate(date) && !isNaN(date)) {\r
2653                     selected = new Date(date);\r
2654                 } else {\r
2655                     if (!selected) {\r
2656                         selected = new Date();\r
2657                     }\r
2658                 }\r
2659 \r
2660                 if (selected) {\r
2661                     var selectedCalendar;\r
2662                     if(scope.mode === 1){\r
2663                         selected = new Date();\r
2664                         selectedCalendar = moveMonth(angular.copy(selected), -1);\r
2665                     } else {\r
2666                         selectedCalendar = angular.copy(selected);\r
2667                     }\r
2668 \r
2669                     var currentMode = datepickerCtrl.modes[scope.mode];\r
2670                     var currentData = currentMode.getVisibleDates(selectedCalendar, 'top');\r
2671                     scope.currentRows = split(currentData.objects, currentMode.split);\r
2672                     scope.currentTitle = currentData.title;\r
2673                     scope.labels = currentData.labels || [];\r
2674 \r
2675                     var nextData = currentMode.getVisibleDates(moveMonth(angular.copy(selectedCalendar), 1), 'bottom');\r
2676                     scope.nextRows = split(nextData.objects, currentMode.split);\r
2677                     scope.nextTitle = nextData.title;\r
2678                 }\r
2679             }\r
2680 \r
2681             var selectCurrentDate = function(date) {\r
2682                 var dt = new Date(date.getFullYear(), date.getMonth(), date.getDate());\r
2683                 scope.currentDate = dt;\r
2684             };\r
2685 \r
2686             var selectFromDate = function(date) {\r
2687                 var dt = new Date(date.getFullYear(), date.getMonth(), date.getDate());\r
2688                 scope.fromDate = dt;\r
2689             };\r
2690 \r
2691             scope.select = function(date) {\r
2692                 calendarSelected = true;\r
2693                 if(attrs.from) {\r
2694                     if(!(angular.isDate(scope.fromDate) && angular.isDate(scope.currentDate))) {\r
2695                         if(angular.isDate(scope.fromDate)) {\r
2696                             selectCurrentDate(date);\r
2697                         } else if(!angular.isDate(scope.fromDate)) {\r
2698                             selectFromDate(date);\r
2699                         }\r
2700                     }\r
2701                 } else {\r
2702                     selectCurrentDate(date);\r
2703                 }\r
2704                 scope.focusedDate = date;\r
2705             };\r
2706 \r
2707             var swapDate = function(fromDate, currentDate) {\r
2708                 selectFromDate(currentDate);\r
2709                 $timeout(function () {\r
2710                     calendarSelected = true;\r
2711                     scope.focusedDate = currentDate;\r
2712                     selectCurrentDate(fromDate);\r
2713                 });\r
2714             };\r
2715 \r
2716             scope.move = function(direction) {\r
2717                 selected = moveMonth(angular.copy(selected), direction);\r
2718                 refill();\r
2719             };\r
2720 \r
2721             scope.$watch('currentDate', function (value) {\r
2722                 if(angular.isDate(value) && !isNaN(value) && datepickerCtrl.isDisabled(value)) {\r
2723                     scope.currentDate = null;\r
2724                     return;\r
2725                 }\r
2726 \r
2727                 if (attrs.from && !isNaN(value) && !isNaN(scope.fromDate) && datepickerCtrl.compare(value, scope.fromDate) < 0) {\r
2728                         swapDate(scope.fromDate, value);\r
2729                         return;\r
2730                 }\r
2731 \r
2732                 if (calendarSelected) {\r
2733                     refill();\r
2734                     calendarSelected = false;\r
2735                 } else {\r
2736                     if (angular.isDefined(value) && value !== null) {\r
2737                         refill(value);\r
2738                     } else {\r
2739                         refill();\r
2740                     }\r
2741                 }\r
2742                 scope.focusedDate = undefined;\r
2743             });\r
2744 \r
2745             scope.$watch('fromDate', function (value) {\r
2746                 if(angular.isDate(value) && !isNaN(value) && datepickerCtrl.isDisabled(value)) {\r
2747                     scope.fromDate = null;\r
2748                     return;\r
2749                 }\r
2750                 if (attrs.from) {\r
2751                     if (!isNaN(scope.currentDate) && !isNaN(value) && datepickerCtrl.compare(scope.currentDate, value) < 0) {\r
2752                         swapDate(value, scope.currentDate);\r
2753                         return;\r
2754                     }\r
2755                     if (calendarSelected) {\r
2756                         refill();\r
2757                         calendarSelected = false;\r
2758                     } else {\r
2759                         if (angular.isDefined(value) && value !== null) {\r
2760                             refill(value);\r
2761                         } else {\r
2762                             refill();\r
2763                         }\r
2764                     }\r
2765                 }\r
2766                 scope.focusedDate = undefined;\r
2767             });\r
2768         }\r
2769     };\r
2770 }])\r
2771 .directive('datepickerPopup', ['$document', 'datepickerService', '$isElement', '$documentBind', function($document, datepickerService, $isElement, $documentBind) {\r
2772     var link = function (scope, elem, attr) {\r
2773         datepickerService.bindScope(attr, scope);\r
2774 \r
2775         scope.isOpen = false;\r
2776 \r
2777         var toggle = scope.toggle = function (show) {\r
2778             if(show === true || show === false) {\r
2779                 scope.isOpen = show;\r
2780             } else {\r
2781                 scope.isOpen = !scope.isOpen;\r
2782             }\r
2783         };\r
2784 \r
2785         scope.$watch('current', function () {\r
2786             toggle(false);\r
2787         });\r
2788 \r
2789         var outsideClick = function (e) {\r
2790             var isElement = $isElement(angular.element(e.target), elem, $document);\r
2791             if(!isElement) {\r
2792                 toggle(false);\r
2793                 scope.$apply();\r
2794             }\r
2795         };\r
2796 \r
2797         $documentBind.click('isOpen', outsideClick, scope);\r
2798     };\r
2799 \r
2800     return {\r
2801         restrict: 'EA',\r
2802         replace: true,\r
2803         transclude: true,\r
2804         templateUrl: 'app/scripts/ng_js_att_tpls/datepicker/datepickerPopup.html',\r
2805         scope: {\r
2806             current: "=current"\r
2807         },\r
2808         compile: function (elem, attr) {\r
2809             var wrapperElement = elem.find('span').eq(1);\r
2810             wrapperElement.attr('current', 'current');\r
2811             datepickerService.setAttributes(attr, wrapperElement);\r
2812 \r
2813             return link;\r
2814         }\r
2815     };\r
2816 }])\r
2817 \r
2818 .directive('attDatepicker', ['$log', function($log) {\r
2819     return {\r
2820         restrict: 'A',\r
2821         require: 'ngModel',\r
2822         scope: {},\r
2823         controller: ['$scope', '$element', '$attrs', '$compile', 'datepickerConfig', 'datepickerService', function($scope, $element, $attrs, $compile, datepickerConfig, datepickerService) {\r
2824             var dateFormatString = angular.isDefined($attrs.dateFormat) ? $scope.$parent.$eval($attrs.dateFormat) : datepickerConfig.dateFormat;\r
2825             var selectedDateMessage = '<div class="sr-focus hidden-spoken" tabindex="-1">the date you selected is {{$parent.current | date : \'' + dateFormatString + '\'}}</div>';\r
2826 \r
2827             $element.removeAttr('att-datepicker');\r
2828             $element.removeAttr('ng-model');\r
2829             $element.attr('ng-model', '$parent.current');\r
2830             $element.attr('aria-describedby', 'datepicker');\r
2831             $element.attr('format-date', dateFormatString);\r
2832             $element.attr('att-input-deny', '[^0-9\/-]');\r
2833             $element.attr('maxlength', 10);\r
2834                         $element.attr('readonly', 'readonly'); //Trinity for CATO\r
2835             var wrapperElement = angular.element('<div></div>');\r
2836             wrapperElement.attr('datepicker-popup', '');\r
2837             wrapperElement.attr('current', 'current');\r
2838 \r
2839             datepickerService.setAttributes($attrs, wrapperElement);\r
2840             datepickerService.bindScope($attrs, $scope);\r
2841 \r
2842             wrapperElement.html('');\r
2843             wrapperElement.append($element.prop('outerHTML'));\r
2844             if (navigator.userAgent.match(/MSIE 8/) === null) {\r
2845                 wrapperElement.append(selectedDateMessage);\r
2846             }\r
2847             var elm = wrapperElement.prop('outerHTML');\r
2848             elm = $compile(elm)($scope);\r
2849             $element.replaceWith(elm);\r
2850         }],\r
2851         link: function(scope, elem, attr, ctrl) {\r
2852             if (!ctrl) {\r
2853                 // do nothing if no ng-model\r
2854                 $log.error("ng-model is required.");\r
2855                 return;\r
2856             }\r
2857 \r
2858             scope.$watch('current', function(value) {\r
2859                 ctrl.$setViewValue(value);\r
2860             });\r
2861             ctrl.$render = function() {\r
2862                 scope.current = ctrl.$viewValue;\r
2863             };\r
2864         }\r
2865     };\r
2866 }])\r
2867 \r
2868 .directive('formatDate', ['dateFilter', 'datepickerService', function(dateFilter, datepickerService) {\r
2869     return {\r
2870         restrict: 'A',\r
2871         require: 'ngModel',\r
2872         link: function(scope, elem, attr, ctrl) {\r
2873             var formatDate = "";\r
2874             attr.$observe('formatDate', function (value) {\r
2875                 formatDate = value;\r
2876             });\r
2877             var dateToString = function(value) {\r
2878                 if (value) {\r
2879                     ctrl.$setValidity('invalidDate', true);\r
2880                     return dateFilter(value, formatDate);\r
2881                 } else {\r
2882                     ctrl.$setValidity('invalidDate', false);\r
2883                     return elem.val();\r
2884                 }\r
2885             };\r
2886             var stringToDate = function(value) {\r
2887                 if(datepickerService.validateDateString(value, formatDate)) {\r
2888                     ctrl.$setValidity('invalidDate', true);\r
2889                     return new Date(value);\r
2890                 } else {\r
2891                     ctrl.$setValidity('invalidDate', false);\r
2892                     return null;\r
2893                 }\r
2894             };\r
2895             ctrl.$formatters.unshift(dateToString);\r
2896             ctrl.$parsers.unshift(stringToDate);\r
2897         }\r
2898     };\r
2899 }])\r
2900 \r
2901 .directive('attDateFilter', ['$document', 'dateFilter', 'datepickerConfig', 'datepickerService', '$isElement', '$documentBind', function($document, dateFilter, datepickerConfig, datepickerService, $isElement, $documentBind) {\r
2902 \r
2903     var link = function (scope, elem, attr, ctrl) {\r
2904         datepickerService.bindScope(attr, scope);\r
2905 \r
2906         scope.selectedOption = datepickerConfig.dateFilter.defaultText;\r
2907         scope.showDropdownList = false;\r
2908         scope.showCalendar = false;\r
2909         scope.applyButtonType = "disabled";\r
2910 \r
2911         scope.currentSelection = "";\r
2912         var dateFormatString = angular.isDefined(attr.dateFormat) ? scope.$parent.$eval(attr.dateFormat) : datepickerConfig.dateFormat;\r
2913         var inputChange = false;\r
2914 \r
2915         var setDropdownText = function(value) {\r
2916             if(inputChange) {\r
2917                 return;\r
2918             }\r
2919 \r
2920             var fromDateText = dateFormatString.toUpperCase();\r
2921             var currentDateText = dateFormatString.toUpperCase();\r
2922 \r
2923             if(!isNaN(new Date(scope.fromDate))) {\r
2924                 fromDateText = dateFilter(scope.fromDate, dateFormatString);\r
2925             }\r
2926             if(!isNaN(new Date(scope.currentDate))) {\r
2927                 currentDateText = dateFilter(scope.currentDate, dateFormatString);\r
2928             }\r
2929 \r
2930             if(value === 'Custom Single Date') {\r
2931                 ctrl.$setValidity('invalidDate', true);\r
2932                 scope.maxLength = 10;\r
2933                 scope.selectedOption = currentDateText;\r
2934             } else if(value === 'Custom Range') {\r
2935                 ctrl.$setValidity('invalidDate', true);\r
2936                 ctrl.$setValidity('invalidDateRange', true);\r
2937                 scope.maxLength = 21;\r
2938                 scope.selectedOption = fromDateText + '-' + currentDateText;\r
2939             }\r
2940         };\r
2941 \r
2942         var clear = scope.clear = function(partial) {\r
2943             scope.fromDate = undefined;\r
2944             scope.currentDate = undefined;\r
2945             scope.applyButtonType = "disabled";\r
2946             if(!partial) {\r
2947                 ctrl.$setValidity('invalidDate', true);\r
2948                 ctrl.$setValidity('invalidDateRange', true);\r
2949                 setDropdownText(scope.currentSelection);\r
2950             }\r
2951         };\r
2952 \r
2953         var showCalendar = function() {\r
2954             scope.showCalendar = true;\r
2955         };\r
2956 \r
2957         var hideCalendar = function() {\r
2958             scope.showCalendar = false;\r
2959             if(scope.currentSelection !== 'Custom Single Date' && scope.currentSelection !== 'Custom Range') {\r
2960                 clear(true);\r
2961             }\r
2962         };\r
2963 \r
2964         var showDropdown = scope.showDropdown = function (show) {\r
2965             if(show === true || show === false) {\r
2966                 scope.showDropdownList = show;\r
2967             } else {\r
2968                 scope.showDropdownList = !scope.showDropdownList;\r
2969             }\r
2970 \r
2971             if (!scope.showDropdownList) {\r
2972                 scope.focusInputButton = true;\r
2973                 hideCalendar();\r
2974             } else {\r
2975                 if (scope.currentSelection === 'Custom Single Date' || scope.currentSelection === 'Custom Range') {\r
2976                     showCalendar();\r
2977                 }\r
2978             }\r
2979         };\r
2980 \r
2981         scope.resetTime = function(date) {\r
2982             var dt;\r
2983             if (!isNaN(new Date(date))) {\r
2984                 dt = new Date(date);\r
2985             } else {\r
2986                 return null;\r
2987             }\r
2988             return new Date(dt.getFullYear(), dt.getMonth(), dt.getDate());\r
2989         };\r
2990 \r
2991         scope.getDropdownText = function () {\r
2992             inputChange = true;\r
2993             var dropdownText = scope.selectedOption;\r
2994 \r
2995             if (scope.currentSelection === 'Custom Single Date') {\r
2996                 if (!isNaN(new Date(dropdownText)) && datepickerService.validateDateString(dropdownText, dateFormatString)) {\r
2997                     ctrl.$setValidity('invalidDate', true);\r
2998                     scope.fromDate = undefined;\r
2999                     scope.currentDate = new Date(dropdownText);\r
3000                 } else {\r
3001                     ctrl.$setValidity('invalidDate', false);\r
3002                     clear(true);\r
3003                 }\r
3004             } else if (scope.currentSelection === 'Custom Range') {\r
3005                 if (dropdownText.indexOf('-') !== -1 && (dropdownText.split('-').length === 2 || dropdownText.split('-').length === 6)) {\r
3006                     ctrl.$setValidity('invalidDateRange', true);\r
3007                     var resultDropdownText = dropdownText.split('-');\r
3008                     if (resultDropdownText.length === 2) {\r
3009                         resultDropdownText[0] = resultDropdownText[0].trim();\r
3010                         resultDropdownText[1] = resultDropdownText[1].trim();\r
3011                     } else if (resultDropdownText.length === 6) {\r
3012                         var firstDateString = resultDropdownText[0].trim() + '-' + resultDropdownText[1].trim() + '-' + resultDropdownText[2].trim();\r
3013                         var secondDateString = resultDropdownText[3].trim() + '-' + resultDropdownText[4].trim() + '-' + resultDropdownText[5].trim();\r
3014                         resultDropdownText[0] = firstDateString;\r
3015                         resultDropdownText[1] = secondDateString;\r
3016                     }\r
3017 \r
3018                     if (!isNaN(new Date(resultDropdownText[0])) && !isNaN(new Date(resultDropdownText[1])) && datepickerService.validateDateString(resultDropdownText[0], dateFormatString) && datepickerService.validateDateString(resultDropdownText[1], dateFormatString)) {\r
3019                         ctrl.$setValidity('invalidDate', true);\r
3020                         var fromDate = new Date(resultDropdownText[0]);\r
3021                         var currentDate = new Date(resultDropdownText[1]);\r
3022                         if(fromDate.getTime() < currentDate.getTime()) {\r
3023                             ctrl.$setValidity('invalidDateRange', true);\r
3024                             scope.fromDate = fromDate;\r
3025                             scope.currentDate = currentDate;\r
3026                         } else {\r
3027                             ctrl.$setValidity('invalidDateRange', false);\r
3028                             clear(true);\r
3029                         }\r
3030                     } else {\r
3031                         ctrl.$setValidity('invalidDate', false);\r
3032                         clear(true);\r
3033                     }\r
3034                 } else {\r
3035                     ctrl.$setValidity('invalidDateRange', false);\r
3036                     clear(true);\r
3037                 }\r
3038             }\r
3039         };\r
3040 \r
3041         scope.untrackInputChange = function() {\r
3042             inputChange = false;\r
3043         };\r
3044 \r
3045         scope.selectAdvancedOption = function (value, notClearFlag) {\r
3046             scope.currentSelection = value;\r
3047             if(!notClearFlag){\r
3048                 clear();\r
3049                 showCalendar();\r
3050             }\r
3051             scope.$watch('currentDate', function(val) {\r
3052                 if(!isNaN(new Date(val))) {\r
3053                     scope.applyButtonType = "primary";\r
3054                     setDropdownText(value);\r
3055                     if (!inputChange) {\r
3056                         scope.focusApplyButton = true;\r
3057                     }\r
3058                 }\r
3059             });\r
3060             scope.$watch('fromDate', function(val) {\r
3061                 if(!isNaN(new Date(val))) {\r
3062                     setDropdownText(value);\r
3063                 }\r
3064             });\r
3065             if (value === 'Custom Single Date') {\r
3066                 scope.focusSingleDateCalendar = true;\r
3067             } else if (value === 'Custom Range') {\r
3068                 scope.focusRangeCalendar = true;\r
3069             }\r
3070         };\r
3071 \r
3072         scope.resetFocus = function () {\r
3073             scope.focusSingleDateCalendar = false;\r
3074             scope.focusRangeCalendar = false;\r
3075             scope.focusApplyButton = false;\r
3076         };\r
3077 \r
3078         scope.apply = function() {\r
3079             scope.dateRange.selection = scope.selectedOption;\r
3080             if(!isNaN(new Date(scope.fromDate))) {\r
3081                 scope.from = scope.fromDate;\r
3082                 scope.dateRange.from = scope.fromDate;\r
3083             } else {\r
3084                 scope.from = undefined;\r
3085                 scope.dateRange.from = undefined;\r
3086             }\r
3087             if(!isNaN(new Date(scope.currentDate))) {\r
3088                 scope.current = scope.currentDate;\r
3089                 scope.dateRange.current = scope.currentDate;\r
3090             } else {\r
3091                 scope.current = undefined;\r
3092                 scope.dateRange.current = undefined;\r
3093             }\r
3094 \r
3095             showDropdown();\r
3096         };\r
3097 \r
3098         scope.$watchCollection(function() {\r
3099             return scope.dateRange;\r
3100         }, function(value) {\r
3101             if(ctrl) {\r
3102                 var finalDateRange = angular.copy(value);\r
3103                 ctrl.$setViewValue(finalDateRange);\r
3104             }\r
3105         });\r
3106 \r
3107         ctrl.$render = function () {\r
3108             if (ctrl.$viewValue) {\r
3109                 var inputRange = ctrl.$viewValue;\r
3110                 scope.selectedOption = inputRange.selection;\r
3111                 scope.fromDate = inputRange.from;\r
3112                 scope.currentDate = inputRange.current;\r
3113                 if (scope.fromDate !== undefined && scope.currentDate !== undefined) {\r
3114                     scope.selectAdvancedOption('Custom Range', true);\r
3115                     scope.dateRange.from = scope.fromDate;\r
3116                     scope.dateRange.current = scope.currentDate;\r
3117                 } else if (scope.currentDate !== undefined) {\r
3118                     scope.selectAdvancedOption('Custom Single Date', true);\r
3119                     scope.dateRange.from = undefined;\r
3120                     scope.dateRange.current = scope.currentDate;\r
3121                 }\r
3122             }\r
3123         };\r
3124         \r
3125         scope.cancel = function() {\r
3126             scope.currentSelection = "";\r
3127             scope.selectedOption = datepickerConfig.dateFilter.defaultText;\r
3128             showDropdown();\r
3129         };\r
3130 \r
3131         var outsideClick = function (e) {\r
3132             var isElement = $isElement(angular.element(e.target), elem, $document);\r
3133             if(!isElement) {\r
3134                 scope.cancel();\r
3135                 scope.$apply();\r
3136             }\r
3137         };\r
3138         $documentBind.click('showDropdownList', outsideClick, scope);\r
3139     };\r
3140 \r
3141     return {\r
3142         restrict: 'EA',\r
3143         scope: {\r
3144             from: '=?from',\r
3145             current: "=?current"\r
3146         },\r
3147         replace: true,\r
3148         require: '?ngModel',\r
3149         transclude:true,\r
3150         templateUrl: 'app/scripts/ng_js_att_tpls/datepicker/dateFilter.html',\r
3151         controller:['$scope', '$element', '$attrs',function($scope){\r
3152             $scope.dateRange = {\r
3153                 selection: undefined,\r
3154                 from: undefined,\r
3155                 current: undefined\r
3156             };\r
3157             this.selectOption = function (fromDate,toDate,caption) {\r
3158                 $scope.selectedOption = caption;\r
3159                 $scope.currentSelection =caption;\r
3160                 $scope.dateRange.selection = caption;\r
3161                 $scope.dateRange.current = $scope.resetTime(toDate);\r
3162                 $scope.dateRange.from = $scope.resetTime(fromDate);\r
3163                 $scope.showDropdown();\r
3164         };\r
3165          $scope.checkCurrentSelection=this.checkCurrentSelection = function(value) {\r
3166             if(value === $scope.currentSelection) {\r
3167                 return true;\r
3168             }\r
3169             return false;\r
3170         };\r
3171         }],\r
3172         compile: function(elem, attr) {\r
3173             var singleDateCalendar = elem.find('span').eq(4);\r
3174             var rangeCalendar = elem.find('span').eq(5);\r
3175             rangeCalendar.attr('from', 'fromDate');\r
3176             singleDateCalendar.attr('current', 'currentDate');\r
3177             rangeCalendar.attr('current', 'currentDate');\r
3178             datepickerService.setAttributes(attr, singleDateCalendar);\r
3179             datepickerService.setAttributes(attr, rangeCalendar);\r
3180 \r
3181             return link;\r
3182         }\r
3183     };\r
3184 }])\r
3185 .directive('attDateFilterList',function(){\r
3186     return{\r
3187         restrict:'EA',\r
3188         scope:{\r
3189             fromDate:'=fromDate',\r
3190             toDate:'=toDate',\r
3191             caption:'=caption',\r
3192             disabled:'=disabled'\r
3193         },\r
3194         require:'^attDateFilter',\r
3195         transclude:true,\r
3196         replace:true,\r
3197         templateUrl:'app/scripts/ng_js_att_tpls/datepicker/dateFilterList.html',\r
3198         link:function(scope,elem,attr,ctrl){\r
3199             scope.selectOption=function(fromDate,toDate,caption){\r
3200                 ctrl.selectOption(fromDate,toDate,caption);\r
3201             };\r
3202             scope.checkCurrentSelection=ctrl.checkCurrentSelection;\r
3203         }\r
3204     };\r
3205 });\r
3206 angular.module('att.abs.devNotes', [])\r
3207 \r
3208   .directive('attDevNotes', function() {\r
3209     return {\r
3210       restrict: 'EA',\r
3211       transclude: true,\r
3212       scope: {},\r
3213       controller: function($scope){\r
3214         var panes = $scope.panes = [];\r
3215         $scope.select = function(pane)\r
3216         {\r
3217             angular.forEach(panes, function(pane)\r
3218             {\r
3219                 pane.selected = false;\r
3220             });\r
3221             pane.selected = true;\r
3222         };\r
3223         this.addPane = function(pane) {\r
3224             if (panes.length === 0) {\r
3225                 $scope.select(pane);\r
3226             }\r
3227           panes.push(pane);\r
3228         };\r
3229       },\r
3230       template:'<div>'+\r
3231         '<ul class="tabs">' +\r
3232             '<li ng-repeat="pane in panes" ng-class="{active:pane.selected}">'+\r
3233               '<a href="javascript:void(0)" ng-click="select(pane)">{{pane.title}}</a>' +\r
3234             '</li>' +\r
3235           '</ul>' +\r
3236           '<div ng-transclude></div>'+\r
3237           '</div>',\r
3238           replace: true\r
3239     };\r
3240   })\r
3241 \r
3242   .directive('pane', function() {\r
3243     return {\r
3244       require: '^attDevNotes',\r
3245       restrict: 'EA',\r
3246       transclude: true,\r
3247       scope: {\r
3248           title: '@'\r
3249       },\r
3250       link: function(scope, element, attrs, tabsCtrl) {\r
3251         tabsCtrl.addPane(scope);\r
3252       },\r
3253       template:\r
3254         '<div class="tab-pane" ng-class="{active: selected}">' +\r
3255         '<pre ng-class="{\'language-markup\':title==\'HTML\',\'language-javascript\':title==\'JavaScript\',\'language-json\':title==\'JSON\'}"  class=" line-numbers">' +\r
3256          '<code ng-transclude></code>' +\r
3257          '</pre>' +\r
3258         '</div>',\r
3259       replace: true\r
3260     };\r
3261   });\r
3262 \r
3263 angular.module('att.abs.dividerLines', [])\r
3264         .directive('attDividerLines', [function()\r
3265             {\r
3266                 return {\r
3267                     scope: {\r
3268                         attDividerLines: '@'\r
3269                     },\r
3270                     restrict: 'A',\r
3271                     replace: true,\r
3272                     templateUrl: 'app/scripts/ng_js_att_tpls/dividerLines/dividerLines.html',\r
3273                     link: function(scope, element, attribute)\r
3274                     {\r
3275                         scope.lightContainer = attribute.attDividerLines;\r
3276                     }\r
3277                 };\r
3278             }]);\r
3279 \r
3280 angular.module('att.abs.dragdrop', [])\r
3281         .directive('attFileDrop', ['$parse', function($parse) {\r
3282                 return {\r
3283                     restrict: 'A',\r
3284                     scope: {\r
3285                         fileModel : '=',\r
3286                         onDrop : '&',\r
3287                         attFileDrop : '&'\r
3288                     },\r
3289                     controller: ['$scope', '$attrs', function($scope, $attrs){\r
3290                         if($attrs.attFileDrop!==""){\r
3291                             $scope.onDrop=$scope.attFileDrop;\r
3292                         }\r
3293                         this.onDrop = $scope.onDrop;\r
3294                     }],\r
3295                     link: function(scope, element) {\r
3296                         element.addClass('dragdrop');\r
3297                         element.bind(\r
3298                             'dragover',\r
3299                             function(e) {\r
3300                                 if(e.originalEvent){\r
3301                                     e.dataTransfer = e.originalEvent.dataTransfer;\r
3302                                 }\r
3303                                 e.dataTransfer.dropEffect = 'move';\r
3304                                 // allows us to drop\r
3305                                 if (e.preventDefault) {\r
3306                                     e.preventDefault();\r
3307                                 }\r
3308                                 element.addClass('dragdrop-over');\r
3309                                 return false;\r
3310                             }\r
3311                         );\r
3312                         element.bind(\r
3313                             'dragenter',\r
3314                             function(e) {\r
3315                                 // allows us to drop\r
3316                                 if (e.preventDefault) {\r
3317                                     e.preventDefault();\r
3318                                 }\r
3319                                 element.addClass('dragdrop-over');\r
3320                                 return false;\r
3321                             }\r
3322                         );\r
3323                         element.bind(\r
3324                             'dragleave',\r
3325                             function() {\r
3326                                 element.removeClass('dragdrop-over');\r
3327                                 return false;\r
3328                             }\r
3329                         );\r
3330                         element.bind(\r
3331                             'drop',\r
3332                             function(e) {\r
3333                                 // Stops some browsers from redirecting.\r
3334                                 if(e.preventDefault) {\r
3335                                     e.preventDefault();\r
3336                                 }\r
3337                                 if (e.stopPropagation) {\r
3338                                     e.stopPropagation();\r
3339                                 }\r
3340                                 if(e.originalEvent){\r
3341                                     e.dataTransfer = e.originalEvent.dataTransfer;\r
3342                                 }\r
3343                                 element.removeClass('dragdrop-over');\r
3344                                 if(e.dataTransfer.files && e.dataTransfer.files.length > 0){\r
3345                                     scope.fileModel = e.dataTransfer.files[0];\r
3346                                     scope.$apply();\r
3347                                     if(typeof scope.onDrop === "function"){\r
3348                                         scope.onDrop = $parse(scope.onDrop);\r
3349                                         scope.onDrop();\r
3350                                     }\r
3351                                 }\r
3352                                 return false;\r
3353                             }\r
3354                         );\r
3355                     }\r
3356                 };\r
3357             }])\r
3358         .directive('attFileLink', [ function() {\r
3359                 return {\r
3360                     restrict: 'EA',\r
3361                     require: '^?attFileDrop',\r
3362                     replace: true,\r
3363                     transclude: true,\r
3364                     templateUrl: 'app/scripts/ng_js_att_tpls/dragdrop/fileUpload.html',\r
3365                     scope: {\r
3366                         fileModel : '=?',\r
3367                         onFileSelect : '&',\r
3368                         attFileLink : '&'\r
3369                     },\r
3370                     controller: ['$scope', '$parse', function($scope, $parse){\r
3371                         this.setFileModel= function(fileModel){\r
3372                             if($scope.takeFileModelFromParent){\r
3373                                 $scope.$parent.fileModel = fileModel;\r
3374                                 $scope.$parent.$apply();\r
3375                             }\r
3376                             else{\r
3377                                 $scope.fileModel = fileModel;\r
3378                                 $scope.$apply();\r
3379                             }\r
3380                         };\r
3381                         this.callbackFunction= function(){\r
3382                             if(typeof $scope.onFileSelect === "function"){\r
3383                                 $scope.onFileSelect = $parse($scope.onFileSelect);\r
3384                                 $scope.onFileSelect();\r
3385                             }\r
3386                         };\r
3387                       \r
3388                     }],\r
3389                     link: function(scope, element, attr, attFileDropCtrl) {\r
3390                         scope.takeFileModelFromParent = false;\r
3391                         if(!(attr.fileModel) && attFileDropCtrl){\r
3392                             scope.takeFileModelFromParent = true;\r
3393                         }\r
3394                         if(attr.attFileLink!==""){\r
3395                             scope.onFileSelect=scope.attFileLink;\r
3396                         }\r
3397                         else if(!(attr.onFileSelect) && attFileDropCtrl){\r
3398                             scope.onFileSelect = attFileDropCtrl.onDrop;\r
3399                         }\r
3400                     }\r
3401                 };\r
3402             }])\r
3403         .directive('attFileChange', ['$log','$rootScope',function($log,$rootScope) {\r
3404                 return {\r
3405                     restrict: 'A',\r
3406                     require: '^attFileLink',\r
3407                     link: function(scope, element, attr, attFileLinkCtrl) {\r
3408                         element.bind('change',changeFileModel);\r
3409                         function changeFileModel(e) {\r
3410                             if (e.target.files && e.target.files.length > 0) {\r
3411                                 attFileLinkCtrl.setFileModel(e.target.files[0]);\r
3412                                 attFileLinkCtrl.callbackFunction();\r
3413                             }\r
3414                             else {\r
3415                                 var strFileName = e.target.value;\r
3416                                 try {\r
3417                                     var objFSO = new ActiveXObject("Scripting.FileSystemObject");\r
3418                                     attFileLinkCtrl.setFileModel(objFSO.getFile(strFileName));\r
3419                                     attFileLinkCtrl.callbackFunction();\r
3420                                 }\r
3421                                 catch (e) {\r
3422                                     var errMsg = "Error: Please follow the guidelines of Drag and Drop component on Sandbox demo page.";\r
3423                                     $log.error(errMsg);\r
3424                                     $rootScope.$broadcast('att-file-link-failure', errMsg);\r
3425                                 }\r
3426                             }\r
3427                         }\r
3428                     }\r
3429                 };\r
3430             }]);\r
3431 angular.module("att.abs.drawer", ['att.abs.utilities'])\r
3432 .directive('attDrawer', ['$document', '$timeout', 'DOMHelper', function ($document, $timeout, DOMHelper) {\r
3433         return {\r
3434             restrict: 'EA',\r
3435             replace: true,\r
3436             transclude: true,\r
3437             scope: {\r
3438                 drawerOpen: "=?",\r
3439                 drawerAutoClose: "&?"\r
3440             },\r
3441             template: '<div><div class="att-drawer" ng-transclude></div><div ng-class="{\'drawer-backdrop\':drawerOpen}"></div></div>',\r
3442             link: function ($scope, element, attrs) {\r
3443                 var param = {};\r
3444                 // First Element in Drawer component\r
3445                 var firstElement = undefined;\r
3446                 // Element drawer is toggled from\r
3447                 var drawerLaunchingElement = undefined;\r
3448                 // Override default parameters\r
3449                 param.side = attrs.drawerSlide || 'top';\r
3450                 param.speed = attrs.drawerSpeed || '0.25';\r
3451                 param.size = attrs.drawerSize || '300px';\r
3452                 param.zindex = attrs.drawerZindex || 1000;\r
3453                 param.className = attrs.drawerClass || 'att-drawer';\r
3454                 var slider = element.eq(0).children()[0];\r
3455                 var content = angular.element(slider).children()[0];\r
3456                 slider.className = param.className;\r
3457                 /* Style setup */\r
3458                 slider.style.transitionDuration = param.speed + 's';\r
3459                 slider.style.webkitTransitionDuration = param.speed + 's';\r
3460                 slider.style.zIndex = param.zindex;\r
3461                 slider.style.position = 'fixed';\r
3462                 slider.style.width = 0;\r
3463                 slider.style.height = 0;\r
3464                 slider.style.transitionProperty = 'width, height';\r
3465                 if(param.side==='right'){\r
3466                     slider.style.height = attrs.drawerCustomHeight || '100%';\r
3467                     slider.style.top = attrs.drawerCustomTop ||  '0px';\r
3468                     slider.style.bottom = attrs.drawerCustomBottom ||  '0px';\r
3469                     slider.style.right = attrs.drawerCustomRight ||  '0px';\r
3470                 }else if(param.side==='left'){      /*Added this part for ECOM*/\r
3471                         slider.style.height = attrs.drawerCustomHeight || '100%';\r
3472                         slider.style.top = attrs.drawerCustomTop ||  '0px';\r
3473                         slider.style.bottom = attrs.drawerCustomBottom ||  '0px';\r
3474                         slider.style.left = attrs.drawerCustomRight ||  '0px';\r
3475                 }\r
3476                 else if(param.side==='top' || param.side==='bottom'){\r
3477                     slider.style.width = attrs.drawerCustomWidth || '100%';\r
3478                     slider.style.left = attrs.drawerCustomLeft || '0px';\r
3479                     slider.style.top = attrs.drawerCustomTop || '0px';\r
3480                     slider.style.right = attrs.drawerCustomRight || '0px';\r
3481                 }\r
3482                 $timeout(function() {\r
3483                     firstElement = DOMHelper.firstTabableElement(element[0]);\r
3484                 }, 10, false);\r
3485                 /* Closed */\r
3486                 function drawerClose(slider, param) {\r
3487                     if (slider && slider.style.width !== 0 && slider.style.height !== 0){\r
3488                         content.style.display = 'none';\r
3489                         if(param.side==='right' || param.side==='left'){\r
3490                             slider.style.width = '0px';\r
3491                         }\r
3492                         else if(param.side==='top' || param.side==='bottom'){\r
3493                             slider.style.height = '0px';\r
3494                         }\r
3495                     }\r
3496                     $scope.drawerOpen = false;\r
3497                     // Shift focus\r
3498                     if (angular.isDefined(drawerLaunchingElement) && drawerLaunchingElement != null) {\r
3499                         drawerLaunchingElement.focus();\r
3500                     }\r
3501                 }\r
3502                 /* Open */\r
3503                 function drawerOpen(slider, param) {\r
3504                     // Before opening drawer, find the focused element\r
3505                     drawerLaunchingElement = document.activeElement;\r
3506                     if (slider.style.width !== 0 && slider.style.height !== 0){\r
3507                         if(param.side==='right' || param.side==='left'){\r
3508                             slider.style.width = param.size;\r
3509                         }\r
3510                         else if(param.side==='top' || param.side==='bottom'){\r
3511                             slider.style.height = param.size;\r
3512                         }\r
3513                         $timeout(function() {\r
3514                             content.style.display = 'block';\r
3515                             // Shift focus\r
3516                             if (angular.isDefined(firstElement) && firstElement != null) {\r
3517                                 firstElement.focus();\r
3518                             }\r
3519                         },(param.speed * 1000));\r
3520                     }\r
3521                 }\r
3522                 function isFunction(functionToCheck) {\r
3523                     var getType = {};\r
3524                     return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\r
3525                 }\r
3526                 /*\r
3527                 * Watchers\r
3528                 * */\r
3529                 if(attrs.drawerSize) {\r
3530                     $scope.$watch(function() {\r
3531                         return attrs.drawerSize;\r
3532                     }, function(newVal) {\r
3533                         param.size = newVal;\r
3534                         if($scope.drawerOpen) {\r
3535                             drawerOpen(slider,param);\r
3536                         }\r
3537                     });\r
3538                 }\r
3539                 $scope.$watch("drawerOpen", function (value){\r
3540                     if (!!value) {\r
3541                         // Open\r
3542                         drawerOpen(slider,param);\r
3543                     } else {\r
3544                         // Close\r
3545                         drawerClose(slider,param);\r
3546                     }\r
3547                 });\r
3548                 // close panel on location change\r
3549                 if($scope.drawerAutoClose()) {\r
3550                     $scope.$on("$locationChangeStart", function(){\r
3551                         drawerClose(slider, param);\r
3552                         if(isFunction($scope.drawerAutoClose())) {\r
3553                             $scope.drawerAutoClose();\r
3554                         }\r
3555                     });\r
3556                     $scope.$on("$stateChangeStart", function(){\r
3557                         drawerClose(slider, param);\r
3558                         if(isFunction($scope.drawerAutoClose)) {\r
3559                             $scope.drawerAutoClose();\r
3560                         }\r
3561                     });\r
3562                 }\r
3563             }\r
3564         };\r
3565     }\r
3566 ]);\r
3567 angular.module('att.abs.message', [])\r
3568 \r
3569 .directive('attMessages', [function() {\r
3570     return {\r
3571         restrict: 'EA',\r
3572         scope: {\r
3573             messageType: '=?'\r
3574         },\r
3575         controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {\r
3576             $scope.messageScope = [];\r
3577             this.registerScope = function(messageScope) {\r
3578                 $scope.messageScope.push(messageScope);\r
3579             };\r
3580             $scope.$parent.$watchCollection($attrs['for'], function(errors) {\r
3581                 for (var key in errors) {\r
3582                     if (errors[key]) {\r
3583                         $scope.error = key;\r
3584                         break;\r
3585                     } else {\r
3586                         $scope.error = null;\r
3587                     }\r
3588                 }\r
3589                 for (var i = 0; i < $scope.messageScope.length; i++) {\r
3590                     if($scope.messageScope[i].when === $scope.error) {\r
3591                         $scope.messageScope[i].show();\r
3592                         $scope.setMessageType($scope.messageScope[i].type);\r
3593                     } else {\r
3594                         $scope.messageScope[i].hide();\r
3595                     }\r
3596                 }\r
3597                 if($scope.error === null) {\r
3598                     $scope.setMessageType(null);\r
3599                 }\r
3600             });\r
3601             $scope.setMessageType = this.setMessageType = function(messageType) {\r
3602                 if($attrs.messageType) {\r
3603                     $scope.messageType = messageType;\r
3604                 }\r
3605             };\r
3606         }]\r
3607     };\r
3608 }])\r
3609 \r
3610 .directive('attMessage', [function() {\r
3611     return {\r
3612         restrict: 'EA',\r
3613         scope: {},\r
3614         require: '^attMessages',\r
3615         link: function(scope, elem, attr, ctrl) {\r
3616             ctrl.registerScope(scope);\r
3617             elem.attr('role', 'alert'); //Trinity CATO\r
3618             scope.when = attr.when || attr.attMessage;\r
3619             scope.type = attr.type;\r
3620             scope.show = function() {\r
3621                 elem.css({display: 'block'});\r
3622             };\r
3623             scope.hide = function() {\r
3624                 elem.css({display: 'none'});\r
3625             };\r
3626             scope.hide();\r
3627         }\r
3628     };\r
3629 }]);\r
3630 \r
3631 angular.module('att.abs.formField', ['att.abs.message', 'att.abs.utilities'])\r
3632 .directive('attFormField', [function() {\r
3633     return {\r
3634         priority: 101,\r
3635         restrict: 'A',\r
3636         controller:function() {\r
3637         },\r
3638         link: function(scope, elem, attr) {\r
3639             elem.wrap('<div class="form-field"></div>');\r
3640             elem.parent().append('<label class="form-field__label">' + attr.placeholder || attr.attFormField + '</label>');\r
3641             elem.wrap('<div class="form-field-input-container"></div>');\r
3642 \r
3643             elem.bind('keyup', function() {\r
3644                 if (this.value !== '') {\r
3645                     elem.parent().parent().find('label').addClass('form-field__label--show').removeClass('form-field__label--hide');\r
3646                 } else {\r
3647                     elem.parent().parent().find('label').addClass('form-field__label--hide').removeClass('form-field__label--show');\r
3648                 }\r
3649             });\r
3650 \r
3651             elem.bind('blur', function() {\r
3652                 if (this.value === '') {\r
3653                     elem.parent().parent().find('label').removeClass('form-field__label--hide');\r
3654                 }\r
3655             });\r
3656         }\r
3657     };\r
3658 }])\r
3659 .directive('attFormFieldValidation', ['$compile', '$log', function($compile, $log) {\r
3660     return {\r
3661         priority: 102,\r
3662         scope: {},\r
3663         restrict: 'A',\r
3664         require: ['?ngModel', '?attFormField'],\r
3665         link: function(scope, elem, attr, ctrl) {\r
3666             var ngCtrl = ctrl[0];\r
3667             var attFormFieldCtrl = ctrl[1];\r
3668             scope.valid = "";\r
3669             if (!ngCtrl) {\r
3670                 $log.error("att-form-field-validation :: ng-model directive is required.");\r
3671                 return;\r
3672             }\r
3673             if (!attFormFieldCtrl) {\r
3674                 $log.error("att-form-field-validation :: att-form-field directive is required.");\r
3675                 return;\r
3676             }\r
3677 \r
3678             elem.parent().append($compile(angular.element('<i class="icon-info-alert error" ng-show="valid===false">&nbsp;</i>'))(scope));\r
3679             elem.parent().append($compile(angular.element('<i class="icon-info-success success" ng-show="valid===true">&nbsp;</i>'))(scope));\r
3680 \r
3681             scope.$watch('valid', function(value) {\r
3682                 if (value) {\r
3683                     elem.parent().parent().addClass('success');\r
3684                 } else if (value === false) {\r
3685                     elem.parent().parent().addClass('error');\r
3686                 } else {\r
3687                     elem.parent().parent().removeClass('success').removeClass('error');\r
3688                 }\r
3689             });\r
3690 \r
3691             elem.bind('keyup', function() {\r
3692                 if (ngCtrl.$valid) {\r
3693                     scope.valid = true;\r
3694                 } else if (ngCtrl.$invalid) {\r
3695                     scope.valid = false;\r
3696                 } else {\r
3697                     scope.valid = "";\r
3698                 }\r
3699                 scope.$apply();\r
3700             });\r
3701         }\r
3702     };\r
3703 }])\r
3704 .directive('attFormFieldValidationAlert', ['$timeout', function($timeout) {\r
3705         return {\r
3706         scope: {\r
3707             messageType: '=?'\r
3708         },\r
3709         restrict: 'EA',\r
3710         replace: true,\r
3711         transclude: true,\r
3712         templateUrl: 'app/scripts/ng_js_att_tpls/formField/attFormFieldValidationAlert.html',\r
3713         link: function(scope, elem, attr, ctrl) {\r
3714             scope.showLabel = false;\r
3715             scope.hideLabel = false;\r
3716             scope.errorMessage = false;\r
3717             scope.warningMessage = false;\r
3718             var checkMessageType = function() {\r
3719                 var messageType = scope.messageType;\r
3720                 if (messageType === 'error') {\r
3721                     scope.errorMessage = true;\r
3722                     scope.warningMessage = false;\r
3723                 } else if (messageType === 'warning') {\r
3724                     scope.errorMessage = false;\r
3725                     scope.warningMessage = true;\r
3726                 } else {\r
3727                     scope.errorMessage = false;\r
3728                     scope.warningMessage = false;\r
3729                 }\r
3730             };\r
3731             var oldIE = navigator.userAgent.toLowerCase().indexOf('msie 8.0') !== -1;\r
3732             elem.find('label').text(elem.find('input').attr('placeholder'));\r
3733             elem.find('input').bind('keyup', function() {\r
3734                 if (this.value !== '') {\r
3735                     scope.showLabel = true;\r
3736                     scope.hideLabel = false;\r
3737                     if (oldIE) {\r
3738                         elem.find('label').css({top: '-20px'});\r
3739                     }\r
3740                 } else {\r
3741                     scope.showLabel = false;\r
3742                     scope.hideLabel = true;\r
3743                     if (oldIE) {\r
3744                         elem.find('label').css({top: '0px'});\r
3745                     }\r
3746                 }\r
3747                 checkMessageType();\r
3748                 scope.$apply();\r
3749             });\r
3750 \r
3751             elem.find('input').bind('blur', function() {\r
3752                 if (this.value === '') {\r
3753                     scope.showLabel = false;\r
3754                     scope.hideLabel = false;\r
3755                 }\r
3756                 scope.$apply();\r
3757             });\r
3758             $timeout(function() {\r
3759                 checkMessageType();\r
3760             }, 100);\r
3761         }\r
3762     };\r
3763 }])\r
3764 .constant("CoreFormsUiConfig", {\r
3765             phoneMask: '(___) ___-____'\r
3766         })\r
3767 .directive('attPhoneMask', ['$parse', 'CoreFormsUiConfig', function($parse, CoreFormsUiConfig) {\r
3768                 return {\r
3769                     require: 'ngModel',\r
3770                     scope: {\r
3771                         ngModel: '='\r
3772                     },\r
3773                     link: function(scope, iElement, iAttrs, ctrl) {\r
3774                         var B = navigator.userAgent.toLowerCase(), C = B.indexOf("android") > -1,\r
3775                                 oldIE = B.indexOf('msie 8.0') !== -1;;\r
3776                         var A = '';\r
3777                         var validPhoneNumber = false;\r
3778                         if (C) {\r
3779                             A = "__________";\r
3780                         }\r
3781                         else {\r
3782                             A = CoreFormsUiConfig.phoneMask;\r
3783                         }\r
3784                         iElement.attr("maxlength", A.length);\r
3785                         var checkValidity = function(unmaskedValue) {\r
3786                         var valid = false;\r
3787                         if (unmaskedValue){\r
3788                         valid = (unmaskedValue.length === 10);}\r
3789                         ctrl.$setValidity('invalidPhoneNumber', validPhoneNumber);\r
3790                         ctrl.$setValidity('mask', valid);\r
3791                         return valid;\r
3792                         };\r
3793                         \r
3794                         var handleKeyup = function() {\r
3795                             var E,D = ctrl.$modelValue;\r
3796                             if (!D.length) {\r
3797                                 return;\r
3798                             }\r
3799                             var L, K, G, J, I;\r
3800                             J = [];\r
3801                             G = A.split("");\r
3802                             I = G.length;\r
3803                             L = D.substring(0, A.length);\r
3804                             K = D.replace(/[^0-9]/g, "").split("");\r
3805                             for (E = 0; E < I; E++) {\r
3806                                 J.push(G[E] === "_" ? K.shift() : G[E]);\r
3807                                 if (K.length === 0) {\r
3808                                     break;\r
3809                                 }\r
3810                             }\r
3811                             D = J.join("");\r
3812                             if (D === '('){\r
3813                                 D = '';}\r
3814                             ctrl.$setViewValue(D);\r
3815                             ctrl.$render();\r
3816                             return D;\r
3817                         };\r
3818 \r
3819 \r
3820                         // since we are only allowing 0-9, why even let the keypress go forward?\r
3821                         // also added in delete... in case they want to delete :)\r
3822                         var handlePress = function(e) {\r
3823                             if (e.which) {\r
3824                                 if ((e.which < 48 || e.which > 57) && (e.which < 96 || e.which > 105)) {\r
3825                                          if (e.which !== 8 && e.which !== 9 && e.which !== 46 && e.which !== 13 && e.which !== 37 && e.which !== 39 &&\r
3826                                             // Allow: Ctrl+V/v\r
3827                                             (e.ctrlKey !== true && (e.which !== '118' || e.which !== '86'))&&\r
3828                                              // Allow: Ctrl+C/c\r
3829                                             (e.ctrlKey !== true && (e.which !== '99' || e.which !== '67'))&&\r
3830                                             // Allow: Ctrl+X/x\r
3831                                             (e.ctrlKey !== true && (e.which !== '120' || e.which !== '88')))\r
3832                                             {\r
3833                                                 e.preventDefault ? e.preventDefault() : e.returnValue = false;\r
3834                                                 iElement.attr("aria-label","Only numbers are allowed");\r
3835                                                 validPhoneNumber = false;\r
3836                                             }}\r
3837                                 else{\r
3838                                         iElement.removeAttr("aria-label");\r
3839                                         validPhoneNumber = true;\r
3840                                     }\r
3841                                    }\r
3842                             scope.$apply();\r
3843                         };\r
3844                         // i moved this out because i thought i might need focus as well..\r
3845                         // to handle setting the model as the view changes\r
3846                         var parser = function(fromViewValue) {\r
3847                             var letters = /^[A-Za-z]+$/;\r
3848                             var numbers = /^[0-9]+$/;\r
3849                             if(fromViewValue.match(letters))\r
3850                                 {validPhoneNumber = false;}\r
3851                             if(fromViewValue.match(numbers))\r
3852                                 {validPhoneNumber = true;}\r
3853                             var clean = "";\r
3854                             if (fromViewValue && fromViewValue.length > 0) {\r
3855                                 clean = fromViewValue.replace(/[^0-9]/g, '');\r
3856                             }\r
3857                             checkValidity(clean);\r
3858                             return clean;\r
3859                         };\r
3860 \r
3861                         //to handle reading the model and formatting it\r
3862                         var formatter = function(fromModelView) {\r
3863                             var input = '';\r
3864                             checkValidity(fromModelView);\r
3865                             if (fromModelView){\r
3866                                 input = handleKeyup();}\r
3867                             return input;\r
3868                         };\r
3869                         ctrl.$parsers.push(parser);\r
3870                         ctrl.$formatters.push(formatter);\r
3871                         iElement.bind('keyup', handleKeyup);\r
3872                         iElement.bind('keydown', handlePress);\r
3873                         iElement.bind('input', function(e){\r
3874                             handleKeyup(e);\r
3875                             handlePress(e);\r
3876                         });\r
3877                     }\r
3878                 };\r
3879 }])\r
3880 .constant('validationTypeInt', {\r
3881             validationNum: {'number':'1','text':'2','email':'3'}\r
3882         })        \r
3883 .directive('attFormFieldPrv', [ 'keyMapAc', 'validationTypeInt', function( keyMapAc, validationTypeInt ) {\r
3884     return {\r
3885         priority: 101,\r
3886         restrict: 'AE',\r
3887                 controller:['$scope', function($scope) {\r
3888                         this.showHideErrorMessage = function ( booleanValue ){\r
3889                                 if(  $scope.$$prevSibling != null && angular.isDefined( $scope.$$prevSibling )\r
3890                                         && angular.isDefined( $scope.$$prevSibling.hideErrorMsg ) ){\r
3891                                         $scope.$$prevSibling.hideErrorMsg = booleanValue;\r
3892                                         $scope.$apply();\r
3893                                 }\r
3894                         };\r
3895                         this.findAllowedCharactor = function( keyCode ){\r
3896                                 var keyMapSc = keyMapAc.keys;\r
3897                                 if( angular.isDefined( $scope.allowedSpecialCharacters )\r
3898                                                 && angular.isDefined( $scope.allowedSpecialCharacters.length )\r
3899                                                 && $scope.allowedSpecialCharacters.length > 0 ){\r
3900                                         var allowedCharList = $scope.allowedSpecialCharacters;\r
3901                                         var charFound = false;\r
3902                                         for( var i=0 ; i < allowedCharList.length ; i++){\r
3903                                                 if( allowedCharList[i] === keyMapSc[keyCode] ){\r
3904                                                         charFound = true;\r
3905                                                         break;\r
3906                                                 }\r
3907                                         }\r
3908                                         return charFound;\r
3909                                 }else{\r
3910                                         return false;\r
3911                                 }\r
3912                         };\r
3913                         this.validateText = function( validationType, allowedChars, validationInput, outputSpecialChars ){\r
3914                                 if( angular.isDefined( allowedChars ) &&  allowedChars.length === 0 ){\r
3915                                         var expAlphanumeric = /^[a-zA-Z0-9]*$/i;\r
3916                                         return expAlphanumeric.test( validationInput );\r
3917                                 }else{\r
3918                                         var expAlphanumericSpecialChar = '^[a-zA-Z0-9' + outputSpecialChars + ']*$';\r
3919                                         var regularExp = new RegExp( expAlphanumericSpecialChar, 'i' );\r
3920                                         return regularExp.test( validationInput );\r
3921                                 }\r
3922                         };\r
3923                         this.validateNumber = function( validationType, allowedChars, validationInput, outputSpecialChars ){\r
3924                                 if( angular.isDefined( allowedChars ) &&  allowedChars.length === 0 ){\r
3925                                         var expNumber = /^[0-9\.]+$/;\r
3926                                         return expNumber.test( validationInput );\r
3927                                 }else{\r
3928                                         var expNumberSpecial = '^[0-9\.' + outputSpecialChars + ']*$';\r
3929                                         var regularExp = new RegExp( expNumberSpecial, 'i' );\r
3930                                         return regularExp.test( validationInput );\r
3931                                 }\r
3932                         };\r
3933                         this.validateEmail = function( validationType, allowedChars, validationInput, outputSpecialChars ){\r
3934                                 if( angular.isDefined( allowedChars ) &&  allowedChars.length === 0 ){\r
3935                                         var expEmail = /(([a-zA-Z0-9\-?\.?]+)@(([a-zA-Z0-9\-_]+\.)+)([a-z]{2,3}))+$/;\r
3936                                         return expEmail.test( validationInput );\r
3937                                 }else{\r
3938                                         var expEmailSpecial = '(([a-z' + outputSpecialChars + 'A-Z0-9\-?\.?]+)@(([a-z'\r
3939                                                 + outputSpecialChars + 'A-Z0-9\-_]+\.)+)([' + outputSpecialChars + 'a-z]{2,3}))+$';\r
3940                                         var regularExp = new RegExp( expEmailSpecial, 'i' );\r
3941                                         return regularExp.test( validationInput );\r
3942                                 }\r
3943                         };\r
3944                         this.validateInput = function( validationType, allowedChars, validationInput ){\r
3945                                 var outputSpecialChars = '';\r
3946                                 var result = false;\r
3947                                 if( angular.isDefined( allowedChars ) && angular.isDefined( allowedChars.length )\r
3948                                         && allowedChars.length > 0 ){\r
3949                                         for( var i = 0; i < allowedChars.length; i++){\r
3950                                                 outputSpecialChars += '\\'+allowedChars[i];\r
3951                                         }\r
3952                                 }\r
3953                                 switch ( validationTypeInt.validationNum[ validationType ] ) {\r
3954                                         case validationTypeInt.validationNum["text"]:\r
3955                                                 result = this.validateText( validationType, allowedChars, validationInput, outputSpecialChars  );\r
3956                                                 break;\r
3957                                         case validationTypeInt.validationNum["number"]:\r
3958                                                 result = this.validateNumber( validationType, allowedChars, validationInput, outputSpecialChars  );\r
3959                                                 break;\r
3960                                         case validationTypeInt.validationNum["email"]:\r
3961                                                 result = this.validateEmail( validationType, allowedChars, validationInput, outputSpecialChars  );\r
3962                                                 break;\r
3963                                         default:\r
3964                                                 break;\r
3965                                 }\r
3966                                 return result;\r
3967                         };\r
3968         }],\r
3969         link: function(scope, elem, attr ) {\r
3970             elem.parent().prepend('<label class="form-field__label">' + attr.placeholder + '</label>');\r
3971             elem.wrap('<div class="form-field-input-container"></div>');\r
3972                         elem.parent().parent().find('label').addClass('form-field__label--show');\r
3973         }\r
3974     };\r
3975 }])\r
3976 .directive('attFormFieldValidationPrv', [ 'keyMapAc','validationTypeInt' , function( keyMapAc, validationTypeInt ) {\r
3977     return {\r
3978         priority: 202,\r
3979         scope: {\r
3980             validationType: '=',\r
3981             allowedChars: '='\r
3982                 },\r
3983         restrict: 'A',\r
3984         require: ['?ngModel', '^attFormFieldPrv'],\r
3985         link: function(scope, elem, attr, ctrl) {\r
3986             var attFormFieldCtrl = ctrl[1];\r
3987             elem.bind('keyup', function() {\r
3988                                 /* email validation has tobe done on keyup */\r
3989                                 if( attFormFieldCtrl.validateInput( scope.validationType, scope.allowedChars, elem[0].value ) ){\r
3990                                         attFormFieldCtrl.showHideErrorMessage(false);\r
3991                                 }\r
3992                                 else{\r
3993                                         attFormFieldCtrl.showHideErrorMessage(true);\r
3994                                 }\r
3995             });\r
3996                         var keyMapSc = keyMapAc.keyRange;\r
3997                         var allowedKeys = keyMapAc.allowedKeys;\r
3998                         var validateTextCode = function( charFound,event ){\r
3999                                 var resultOne = (event.which < keyMapSc['startNum'] || event.which > keyMapSc['endNum'] );\r
4000                                 var resultTwo = (event.which < keyMapSc['startCapitalLetters'] || event.which > keyMapSc['endCapitalLetters'] );\r
4001                                 var resultThree = (event.which < keyMapSc['startSmallLetters'] || event.which > keyMapSc['endSmallLetters'] );\r
4002                                 var result = ( resultOne && resultTwo &&  resultThree );\r
4003                                 return ( result && ( !charFound )  );\r
4004                         };\r
4005                         var validateNumberCode = function( charFound,event ){\r
4006                                 return ( ( event.which < keyMapSc['startNum'] || event.which > keyMapSc['endNum'] ) &&   ( !charFound ) );\r
4007                         };\r
4008                         var validateEmailCode = function( charFound,event ){\r
4009                                 var condOne = String.fromCharCode( event.which ) !== '-' && String.fromCharCode( event.which ) !== '_';\r
4010                                 var condTwo = String.fromCharCode( event.which ) !== '@' && String.fromCharCode( event.which ) !== '.';\r
4011                                 var ifAllowedChars = condOne && condTwo;\r
4012                                 var ifCharRange = validateTextCode( charFound,event );\r
4013                                 return (  ( !charFound ) && ifAllowedChars && ifCharRange );\r
4014                         };\r
4015                         var validateSwitch = function( validationTypeSwitch, charFound, event ){\r
4016                                 switch ( validationTypeSwitch ) {\r
4017                                                 case validationTypeInt.validationNum["text"]:\r
4018                                                         /* 97-122 65-90 48-57 if keyCode is outside range of alphanumeric chars and not found in list then prevent */\r
4019                                                         if( validateTextCode( charFound, event ) ){\r
4020                                                                 return true;\r
4021                                                         }\r
4022                                                         break;\r
4023                                                 case validationTypeInt.validationNum["number"]:\r
4024                                                         /* if key code is outside number range and notfound then prevent */\r
4025                                                         if( validateNumberCode( charFound, event ) ){\r
4026                                                                 return true;\r
4027                                                         }\r
4028                                                         break;\r
4029                                                 case validationTypeInt.validationNum["email"]:\r
4030                                                         /* if keyCode is outside charactor/number range and not _-@. then prevent */\r
4031                                                         if( validateEmailCode( charFound, event ) ){\r
4032                                                                 return true;\r
4033                                                         }\r
4034                                                         break;\r
4035                                                 default:\r
4036                                                         break;\r
4037                                 }\r
4038                                 return false;\r
4039                         };\r
4040                         /* key stroke prevention has to be happen on numeric and alphanumeric fields */\r
4041                         elem.bind('keypress', function( event ){\r
4042                                 if(!(event.which)){\r
4043                                     if(event.keyCode){\r
4044                                         event.which = event.keyCode;\r
4045                                     }\r
4046                                     else if(event.charCode){\r
4047                                         event.which = event.charCode;\r
4048                                     }\r
4049                                 }\r
4050                                 var charFound = attFormFieldCtrl.findAllowedCharactor( event.which );\r
4051                                 var insideCondOne = ( angular.isDefined( scope.validationType ) && scope.validationType !== '');\r
4052                                 var insideCondTwo = ( event.which !== allowedKeys['TAB']\r
4053                                         && event.which !== allowedKeys['BACKSPACE'] && event.which!== allowedKeys['DELETE'] );\r
4054                                 var goInside = insideCondOne && insideCondTwo;\r
4055                                 if( goInside && validateSwitch( validationTypeInt.validationNum[ scope.validationType ], charFound, event ) ){\r
4056                                         event.preventDefault();\r
4057                                 }\r
4058                         });\r
4059         }\r
4060     };\r
4061 }])\r
4062 .directive('attFormFieldValidationAlertPrv', [ function() {\r
4063         return {\r
4064                         restrict: 'A',\r
4065                         scope : { errorMessage : '=' },\r
4066                         transclude: true,\r
4067                         templateUrl: 'app/scripts/ng_js_att_tpls/formField/attFormFieldValidationAlertPrv.html',\r
4068                         link: function( scope ) {\r
4069                                 scope.errorMessage = scope.errorMessage;\r
4070                                 if( angular.isDefined( scope.$parent.hideErrorMsg ) ){\r
4071                                         scope.hideErrorMsg = scope.$parent.hideErrorMsg;\r
4072                                 }\r
4073                                 else{\r
4074                                         scope.hideErrorMsg = true;\r
4075                                 }\r
4076                         }\r
4077                 };\r
4078 }])\r
4079 //Credit card validation directives starts here\r
4080 .factory('Cards', [function() {\r
4081         var defaultFormat = /(\d{1,4})/g;\r
4082         var defaultInputFormat = /(?:^|\s)(\d{4})$/;\r
4083         var cards = [\r
4084             {\r
4085                 type: 'discover',\r
4086                 pattern: /^(6011|65|64[4-9]|622)/,\r
4087                 format: defaultFormat,\r
4088                 inputFormat: defaultInputFormat,\r
4089                 length: [16],\r
4090                 cvcLength: [3],\r
4091                 cvcSecurityImg: 'visaI',\r
4092                 zipLength: [5],\r
4093                 luhn: true\r
4094             },\r
4095             {\r
4096                 type: 'mc',\r
4097                 pattern: /^5[1-5]/,\r
4098                 format: defaultFormat,\r
4099                 inputFormat: defaultInputFormat,\r
4100                 length: [16],\r
4101                 cvcLength: [3],\r
4102                 cvcSecurityImg: 'visaI',\r
4103                 zipLength: [5],\r
4104                 luhn: true\r
4105             },\r
4106             {\r
4107                 type: 'amex',\r
4108                 pattern: /^3[47]/,\r
4109                 format: /(\d{1,4})(\d{1,6})?(\d{1,5})?/,\r
4110                 inputFormat: /^(\d{4}|\d{4}\s\d{6})$/,\r
4111                 length: [15],\r
4112                 cvcLength: [4],\r
4113                 cvcSecurityImg: 'amexI',\r
4114                 zipLength: [5],\r
4115                 luhn: true\r
4116             },\r
4117             {\r
4118                 type: 'visa',\r
4119                 pattern: /^4/,\r
4120                 format: defaultFormat,\r
4121                 inputFormat: defaultInputFormat,\r
4122                 length: [16],\r
4123                 cvcLength: [3],\r
4124                 cvcSecurityImg: 'visaI',\r
4125                 zipLength: [5],\r
4126                 luhn: true\r
4127             }\r
4128         ];\r
4129 \r
4130         var _fromNumber = function(num) {\r
4131             var card, i, len;\r
4132 \r
4133             num = (num + '').replace(/\D/g, '');\r
4134 \r
4135             for (i = 0, len = cards.length; i < len; i++) {\r
4136 \r
4137                 card = cards[i];\r
4138 \r
4139                 if (card.pattern.test(num)) {\r
4140                     return card;\r
4141                 }\r
4142 \r
4143             }\r
4144         };\r
4145 \r
4146         var _fromType = function(type) {\r
4147             var card, i, len;\r
4148 \r
4149             for (i = 0, len = cards.length; i < len; i++) {\r
4150 \r
4151                 card = cards[i];\r
4152 \r
4153                 if (card.type === type) {\r
4154                     return card;\r
4155                 }\r
4156 \r
4157             }\r
4158         };\r
4159 \r
4160         return {\r
4161             fromNumber: function(val) {\r
4162                 return _fromNumber(val);\r
4163             },\r
4164             fromType: function(val) {\r
4165                 return _fromType(val);\r
4166             },\r
4167             defaultFormat: function() {\r
4168                 return defaultFormat;\r
4169             },\r
4170             defaultInputFormat: function() {\r
4171                 return defaultInputFormat;\r
4172             }\r
4173         };\r
4174 \r
4175     }])\r
4176 .factory('_Validate', ['Cards', '$parse', function(Cards, $parse) {\r
4177         var __indexOf = [].indexOf || function(item)\r
4178         {\r
4179             for (var i = 0, l = this.length; i < l; i++)\r
4180             {\r
4181                 if (i in this && this[i] === item)\r
4182                 {\r
4183                     return i;\r
4184                 }\r
4185             }\r
4186             return -1;\r
4187         };\r
4188 \r
4189         var _luhnCheck = function(num) {\r
4190             var digit, digits, odd, sum, i, len;\r
4191 \r
4192             odd = true;\r
4193             sum = 0;\r
4194             digits = (num + '').split('').reverse();\r
4195 \r
4196             for (i = 0, len = digits.length; i < len; i++) {\r
4197 \r
4198                 digit = digits[i];\r
4199                 digit = parseInt(digit, 10);\r
4200 \r
4201                 if ((odd = !odd)) {\r
4202                     digit *= 2;\r
4203                 }\r
4204 \r
4205                 if (digit > 9) {\r
4206                     digit -= 9;\r
4207                 }\r
4208 \r
4209                 sum += digit;\r
4210 \r
4211             }\r
4212 \r
4213             return sum % 10 === 0;\r
4214         };\r
4215 \r
4216         var _validators = {};\r
4217 \r
4218         _validators['cvc'] = function(cvc, ctrl, scope, attr) {\r
4219             var ref, ref1;\r
4220 \r
4221             // valid if empty - let ng-required handle empty\r
4222             if ((angular.isUndefined(cvc)) || (cvc === null) || (cvc.length === 0))\r
4223             {\r
4224                 return true;\r
4225             }\r
4226 \r
4227             if (!/^\d+$/.test(cvc)) {\r
4228                 return false;\r
4229             }\r
4230 \r
4231             var type;\r
4232             if (attr.paymentsTypeModel) {\r
4233                 var typeModel = $parse(attr.paymentsTypeModel);\r
4234                 type = typeModel(scope);\r
4235             }\r
4236 \r
4237             if (type)\r
4238             {\r
4239                 ref1 = Cards.fromType(type);\r
4240                 return (ref = cvc.length, __indexOf.call((ref1 !== null) ? ref1.cvcLength : void 0, ref)) >= 0;\r
4241             }\r
4242             else\r
4243             {\r
4244                 return cvc.length >= 3 && cvc.length <= 4;\r
4245             }\r
4246         };\r
4247         _validators['zip'] = function(zip, ctrl, scope, attr) {\r
4248             var ref, ref1;\r
4249 \r
4250             // valid if empty - let ng-required handle empty\r
4251             if ((angular.isUndefined(zip)) || (zip === null) || (zip.length === 0))\r
4252             {\r
4253                 return true;\r
4254             }\r
4255 \r
4256             if (!/^\d+$/.test(zip)) {\r
4257                 return false;\r
4258             }\r
4259 \r
4260             var type;\r
4261             if (attr.paymentsTypeModel) {\r
4262                 var typeModel = $parse(attr.paymentsTypeModel);\r
4263                 type = typeModel(scope);\r
4264             }\r
4265             if (type)\r
4266             {\r
4267                 ref1 = Cards.fromType(type);\r
4268                 return (ref = zip.length, __indexOf.call(ref1 !== null ? ref1.zipLength : void 0, ref)) >= 0;\r
4269             }\r
4270             else\r
4271             {\r
4272                 return zip.length < 6;\r
4273             }\r
4274         };\r
4275         _validators['card'] = function(num, ctrl, scope, attr) {\r
4276             var card, ref, typeModel;\r
4277 \r
4278             if (attr.paymentsTypeModel) {\r
4279                 typeModel = $parse(attr.paymentsTypeModel);\r
4280             }\r
4281 \r
4282             var clearCard = function() {\r
4283                 if (typeModel) {\r
4284                     typeModel.assign(scope, null);\r
4285                 }\r
4286                 ctrl.$card = null;\r
4287             };\r
4288 \r
4289             // valid if empty - let ng-required handle empty\r
4290             if ((angular.isUndefined(num)) || (num === null) || (num.length === 0)) {\r
4291                 clearCard();\r
4292                 return true;\r
4293             }\r
4294 \r
4295             num = (num + '').replace(/\s+|-/g, '');\r
4296 \r
4297             if (!/^\d+$/.test(num)) {\r
4298                 clearCard();\r
4299                 return false;\r
4300             }\r
4301 \r
4302             card = Cards.fromNumber(num);\r
4303             if (!card) {\r
4304                 clearCard();\r
4305                 return false;\r
4306             }\r
4307             ctrl.$card = angular.copy(card);\r
4308 \r
4309             if (typeModel) {\r
4310                 typeModel.assign(scope, card.type);\r
4311             }\r
4312 \r
4313             ret = (ref = num.length, __indexOf.call(card.length, ref) >= 0) && (card.luhn === false || _luhnCheck(num));\r
4314             return ret;\r
4315         };\r
4316         return function(type, val, ctrl, scope, attr) {\r
4317             if (!_validators[type]) {\r
4318 \r
4319                 types = Object.keys(_validators);\r
4320 \r
4321                 errstr = 'Unknown type for validation: "' + type + '". ';\r
4322                 errstr += 'Should be one of: "' + types.join('", "') + '"';\r
4323 \r
4324                 throw errstr;\r
4325             }\r
4326             return _validators[type](val, ctrl, scope, attr);\r
4327         };\r
4328     }])\r
4329 .factory('_ValidateWatch', ['_Validate', function(_Validate) {\r
4330 \r
4331         var _validatorWatches = {};\r
4332 \r
4333         _validatorWatches['cvc'] = function(type, ctrl, scope, attr) {\r
4334             if (attr.paymentsTypeModel) {\r
4335                 scope.$watch(attr.paymentsTypeModel, function(newVal, oldVal) {\r
4336                     if (newVal !== oldVal) {\r
4337                         var valid = _Validate(type, ctrl.$modelValue, ctrl, scope, attr);\r
4338                         ctrl.$setValidity(type, valid);\r
4339                     }\r
4340                 });\r
4341             }\r
4342         };\r
4343         _validatorWatches['zip'] = function(type, ctrl, scope, attr) {\r
4344             if (attr.paymentsTypeModel) {\r
4345                 scope.$watch(attr.paymentsTypeModel, function(newVal, oldVal) {\r
4346                     if (newVal !== oldVal) {\r
4347                         var valid = _Validate(type, ctrl.$modelValue, ctrl, scope, attr);\r
4348                         ctrl.$setValidity(type, valid);\r
4349                     }\r
4350                 });\r
4351             }\r
4352         };\r
4353         return function(type, ctrl, scope, attr) {\r
4354             if (_validatorWatches[type]) {\r
4355                 return _validatorWatches[type](type, ctrl, scope, attr);\r
4356             }\r
4357         };\r
4358     }])\r
4359 .directive('validateCard', ['$window', '_Validate', '_ValidateWatch', function($window, _Validate, _ValidateWatch) {\r
4360         return {\r
4361             restrict: 'A',\r
4362             require: 'ngModel',\r
4363             link: function(scope, elem, attr, ctrl) {\r
4364 \r
4365                 var type = attr.validateCard;\r
4366                 _ValidateWatch(type, ctrl, scope, attr);\r
4367                 var validateFn = function(val) {\r
4368                     var valid = _Validate(type, val, ctrl, scope, attr);\r
4369                     ctrl.$setValidity(type, valid);\r
4370                     if (type === 'card')\r
4371                     {\r
4372                         if (ctrl.$card === null)\r
4373                         {\r
4374                             if ((val == null) || (val === "") || (val === ''))\r
4375                             {\r
4376                                 scope.invalidCardError = '';\r
4377                                 scope.invalidCard = "";\r
4378                             }\r
4379                             else if (val.length >= 1)\r
4380                             {\r
4381                                 scope.invalidCardError = 'error';\r
4382                                 scope.invalidCard = "The number entered is not a recognized credit card number.";\r
4383                             }\r
4384                         }\r
4385                         else\r
4386                         {\r
4387                             if (!valid)\r
4388                             {\r
4389                                 if (ctrl.$card.length.indexOf(val.length) >= 0)\r
4390                                 {\r
4391                                     scope.invalidCardError = 'error';\r
4392                                     scope.invalidCard = "The number entered is not a recognized credit card number.";\r
4393                                 }\r
4394                                 else\r
4395                                 {\r
4396                                     scope.invalidCardError = '';\r
4397                                     scope.invalidCard = "";\r
4398                                 }\r
4399                             }\r
4400                             else\r
4401                             {\r
4402                                 scope.invalidCardError = '';\r
4403                                 scope.invalidCard = "";\r
4404                             }\r
4405                         }\r
4406                         elem.bind("blur", function()\r
4407                         {\r
4408                             if ((!valid) || (ctrl.$card === null))\r
4409                             {\r
4410                                 scope.invalidCardError = 'error';\r
4411                                 scope.invalidCard = "The number entered is not a recognized credit card number.";\r
4412                             }\r
4413                             else\r
4414                             {\r
4415                                 scope.invalidCardError = '';\r
4416                                 scope.invalidCard = "";\r
4417                             }\r
4418                         });\r
4419                     }\r
4420                     return valid ? val : undefined;\r
4421                 };\r
4422                 ctrl.$formatters.push(validateFn);\r
4423                 ctrl.$parsers.push(validateFn);\r
4424             }\r
4425         };\r
4426     }])\r
4427 .directive('creditCardImage', function() {\r
4428     return{\r
4429         templateUrl: 'app/scripts/ng_js_att_tpls/formField/creditCardImage.html',\r
4430         replace: false,\r
4431         transclude: false,\r
4432         link: function(scope, element, attr)\r
4433         {\r
4434             scope.$watch(attr.creditCardImage, function(newVal, oldVal)\r
4435             {\r
4436                 if (newVal !== oldVal)\r
4437                 {\r
4438                     scope.cvc = '';\r
4439                     if (!angular.isUndefined(newVal) && newVal !== null)\r
4440                     {\r
4441                         scope.newValCCI = 'show-' + newVal;\r
4442                     }\r
4443                     if (newVal === null)\r
4444                     {\r
4445                         scope.newValCCI = '';\r
4446                     }\r
4447                 }\r
4448             });\r
4449         }\r
4450     };\r
4451 })\r
4452 .directive('securityCodeImage', ['$document', function($document) {\r
4453         return{\r
4454             templateUrl: 'app/scripts/ng_js_att_tpls/formField/cvcSecurityImg.html',\r
4455             replace: false,\r
4456             transclude: false,\r
4457             link: function(scope, element, attr)\r
4458             {\r
4459                 scope.$watch(attr.securityCodeImage, function(newVal, oldVal)\r
4460                 {\r
4461                     if (newVal !== oldVal)\r
4462                     {\r
4463                         if (!angular.isUndefined(newVal) && newVal !== null)\r
4464                         {\r
4465                             if (newVal === 'amexI')\r
4466                             {\r
4467                                 scope.newValI = 'ccv2-security-amex';\r
4468                                 scope.newValIAlt = "The 4 digit CVC security code is on the front of the card.";\r
4469                                 scope.cvcPlaceholder = "4 digits";\r
4470                                 scope.cvcMaxlength = 4;\r
4471                             }\r
4472                             else if (newVal === 'visaI')\r
4473                             {\r
4474                                 scope.newValI = 'ccv2-security';\r
4475                                 scope.newValIAlt = "The CVC security code is on the back of your card right after the credit card number.";\r
4476                                 scope.cvcPlaceholder = "3 digits";\r
4477                                 scope.cvcMaxlength = 3;\r
4478                             }\r
4479                         }\r
4480                         if (newVal === null)\r
4481                         {\r
4482                             scope.newValI = 'ccv2-security';\r
4483                             scope.cvcPlaceholder = "3 digits";\r
4484                             scope.cvcMaxlength = 3;\r
4485                             scope.newValIAlt = "The CVC security code is on the back of your card right after the credit card number.";\r
4486                         }\r
4487 \r
4488                     }\r
4489                 });\r
4490                 element.bind("click", function(ev) {\r
4491                     ev.preventDefault();\r
4492                     if (element.find("button").hasClass("active")) {\r
4493                         element.find("button").removeClass("active");\r
4494                     }\r
4495                     else {\r
4496                         element.find("button").addClass("active");\r
4497                     }\r
4498                 });\r
4499 \r
4500                 var window = angular.element($document);\r
4501                 window.bind("click", function(ev) {\r
4502                     var targetClassname = ev.target.className;\r
4503                     if ((targetClassname !== "btn btn-alt btn-tooltip active")) {\r
4504                         if (element.find("button").hasClass("active")) {\r
4505                             element.find("button").removeClass("active");\r
4506                         }\r
4507                     }\r
4508 \r
4509                 });\r
4510             }\r
4511         };\r
4512     }]);\r
4513 \r
4514 angular.module('att.abs.hourpicker', ['att.abs.utilities'])\r
4515     .constant('hourpickerConfig', {\r
4516         days: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],\r
4517         customOption: 'Custom'\r
4518     })\r
4519 \r
4520 .controller('hourPickerController', ['$scope', function ($scope) {\r
4521 \r
4522     $scope.options = [];\r
4523     this.setOptions = function (value, fromtime, totime, preselect, uncheckedFromTime, uncheckedToTime) {\r
4524         $scope.options.push(value);\r
4525 \r
4526         if (preselect !== undefined) {\r
4527             $scope.preselect = preselect;\r
4528         }\r
4529 \r
4530         var daycount;\r
4531 \r
4532         if (fromtime !== undefined) {\r
4533             $scope.fromtime = fromtime;\r
4534             for (daycount in $scope.days) {\r
4535                 if ($scope.days.hasOwnProperty(daycount)) {\r
4536                     $scope.FrtimeList[$scope.days[daycount]] = {};\r
4537                     if (uncheckedFromTime !== undefined) {\r
4538                         $scope.FrtimeList[$scope.days[daycount]].value = uncheckedFromTime;\r
4539                         $scope.selectedFromOption[$scope.days[daycount]] = uncheckedFromTime;\r
4540                     } else {\r
4541                         $scope.FrtimeList[$scope.days[daycount]].value = fromtime[0].value;\r
4542                         $scope.selectedFromOption[$scope.days[daycount]] = fromtime[0].value;\r
4543                     }\r
4544                 }\r
4545             }\r
4546         }\r
4547         if (totime !== undefined) {\r
4548             $scope.totime = totime;\r
4549             for (daycount in $scope.days) {\r
4550                 if ($scope.days.hasOwnProperty(daycount)) {\r
4551                     $scope.TotimeList[$scope.days[daycount]] = {};\r
4552                     if (uncheckedToTime !== undefined) {\r
4553                         $scope.TotimeList[$scope.days[daycount]].value = uncheckedToTime;\r
4554                         $scope.selectedToOption[$scope.days[daycount]] = uncheckedToTime;\r
4555                     } else {\r
4556                         $scope.TotimeList[$scope.days[daycount]].value = totime[0].value;\r
4557                         $scope.selectedToOption[$scope.days[daycount]] = totime[0].value;\r
4558                     }\r
4559                     $scope.showToTimeErrorDay[$scope.days[daycount]] = false;\r
4560                 }\r
4561             }\r
4562         }\r
4563 \r
4564         if (uncheckedFromTime !== undefined) {\r
4565             $scope.uncheckedFromTime = uncheckedFromTime;\r
4566         }\r
4567         if (uncheckedToTime !== undefined) {\r
4568             $scope.uncheckedToTime = uncheckedToTime;\r
4569         }\r
4570     };\r
4571 \r
4572     this.getSelectedOption = function () {\r
4573         return $scope.selectedOption;\r
4574     };\r
4575 \r
4576     this.setToTimeErrorDay = function (day, flag) {\r
4577         $scope.showToTimeErrorDay[day] = flag;\r
4578     };\r
4579 }])\r
4580 \r
4581 .directive('attHourpickerOption', [function () {\r
4582     return {\r
4583         restrict: 'EA',\r
4584         require: '^attHourpicker',\r
4585         scope: {\r
4586             option: "=option",\r
4587             fromtime: "=fromtime",\r
4588             totime: "=totime",\r
4589             preselect: "=preselect",\r
4590             uncheckedFromTime: "=",\r
4591             uncheckedToTime: "="\r
4592         },\r
4593         link: function (scope, element, attr, ctrl) {\r
4594             ctrl.setOptions(scope.option,\r
4595                 scope.fromtime,\r
4596                 scope.totime,\r
4597                 scope.preselect,\r
4598                 scope.uncheckedFromTime,\r
4599                 scope.uncheckedToTime);\r
4600         }\r
4601     };\r
4602 }])\r
4603 \r
4604 .directive('attHourpicker', ["hourpickerConfig", "$document", "$log", "$documentBind", "$timeout", function (hourpickerConfig, $document, $log, $documentBind, $timeout) {\r
4605     return {\r
4606         require: 'ngModel',\r
4607         restrict: 'EA',\r
4608         controller: 'hourPickerController',\r
4609         transclude: true,\r
4610         scope: {\r
4611             model: "=ngModel",\r
4612             resetFlag: "=?"\r
4613         },\r
4614         templateUrl: 'app/scripts/ng_js_att_tpls/hourpicker/hourpicker.html',\r
4615         link: function (scope, element, attr, ctrl) {\r
4616             var flag = false;\r
4617             scope.isFromDropDownOpen = false;\r
4618             scope.isToDropDownOpen = false;\r
4619             var dropDownOpenValue = "";\r
4620             var custTime = {};\r
4621             scope.days = hourpickerConfig.days;\r
4622             scope.daysList = {};\r
4623             scope.FrtimeList = {};\r
4624             scope.FrtimeListDay = {};\r
4625             scope.TotimeListDay = {};\r
4626             scope.selectedFromOption = {};\r
4627             scope.selectedToOption = {};\r
4628             scope.TotimeList = {};\r
4629             scope.selectedIndex = 0;\r
4630             scope.selectedOption = "Select from list";\r
4631             scope.customTime = [];\r
4632 \r
4633             scope.resetFlag = false;\r
4634             scope.showToTimeErrorDay = {};\r
4635             scope.validatedCustomPreselect = [];\r
4636 \r
4637             scope.$watch('resetFlag', function (newVal, oldVal) {\r
4638                 if (newVal !== oldVal) {\r
4639                     if (newVal && scope.selectedOption === hourpickerConfig.customOption) {\r
4640                         //disable and reset all days checkbox\r
4641                         for (day in scope.daysList) {\r
4642                             if (scope.daysList.hasOwnProperty(day)) {\r
4643                                 scope.daysList[day] = false;\r
4644                                 scope.addSelectedValue(day);\r
4645                             }\r
4646                         }\r
4647                         scope.preselectUpdateFxn(scope.preselect);\r
4648                     }\r
4649                     scope.resetFlag = false;\r
4650                 }\r
4651             });\r
4652 \r
4653             scope.$watch('selCategory', function (value) {\r
4654                 if (value) {\r
4655                     ctrl.$setViewValue(value);\r
4656                 }\r
4657             }, true);\r
4658 \r
4659             scope.updateData = function (value) {\r
4660                 if (value.constructor === Array) {\r
4661                     scope.showDaysSelector = true;\r
4662                     scope.selectedOption = hourpickerConfig.customOption;\r
4663                     for (var arry in value) {\r
4664                         if (value.hasOwnProperty(arry)) {\r
4665                             var day = value[arry].day;\r
4666                             \r
4667                             if (typeof value[arry].preEnabled === 'boolean' && value[arry].preEnabled) {\r
4668                                 scope.daysList[day] = true;\r
4669                             } else {\r
4670                                 scope.daysList[day] = false;\r
4671                             }\r
4672                             \r
4673                             for (var fromcount in scope.fromtime) {\r
4674                                 if (scope.fromtime[fromcount].value === value[arry].FromTime && !scope.uncheckedFromTime) {\r
4675                                     scope.FrtimeList[day].value = scope.fromtime[fromcount].value;\r
4676                                     scope.selectedFromOption[day] = scope.FrtimeList[day].value;\r
4677                                 }\r
4678                             }\r
4679                             for (var tocount in scope.totime) {\r
4680                                 if (scope.totime[tocount].value === value[arry].ToTime && !scope.uncheckedToTime) {\r
4681                                     scope.TotimeList[day].value = scope.totime[tocount].value;\r
4682                                     scope.selectedToOption[day] = scope.TotimeList[day].value;\r
4683                                 }\r
4684                             }\r
4685                             \r
4686                             scope.addSelectedValue(day, value[arry].FromTime, value[arry].ToTime);\r
4687 \r
4688                             //for IE8 Fix\r
4689                             if (parseInt(arry) + 1 === value.length) {\r
4690                                 break;\r
4691                             }\r
4692                         }\r
4693                     }\r
4694                 } else {\r
4695                     scope.selectOption(value.day);\r
4696                 }\r
4697             };\r
4698 \r
4699             scope.$watch('preselect', function (value) {\r
4700                 scope.preselectUpdateFxn(value);\r
4701             });\r
4702 \r
4703             scope.preselectUpdateFxn = function (value) {\r
4704                 if (value !== undefined) {\r
4705                     if (scope.options) {\r
4706                         value = scope.validatePreselectData(value);\r
4707                     }\r
4708                     if (value === "") {\r
4709                         return;\r
4710                     }\r
4711                     scope.updateData(value);\r
4712                 }\r
4713             };\r
4714 \r
4715             scope.validatePreselectData = function (value) {\r
4716                 if (value.constructor === Array) {\r
4717                     for (var arry in value) {\r
4718                         if (value.hasOwnProperty(arry)) {\r
4719                             var day = value[arry].day;\r
4720                             var isDayFound = false;\r
4721                             var isFrmFound = false;\r
4722                             var isToFound = false;\r
4723                             for (var daycount in scope.days) {\r
4724                                 if (scope.days[daycount] === day) {\r
4725                                     isDayFound = true;\r
4726                                     break;\r
4727                                 }\r
4728                             }\r
4729                             if (!isDayFound) {\r
4730                                 value.splice(arry, 1);\r
4731                                 continue;\r
4732                             }\r
4733                             for (var fromcount in scope.fromtime) {\r
4734                                 if (scope.fromtime[fromcount].value === value[arry].FromTime) {\r
4735                                     isFrmFound = true;\r
4736                                     break;\r
4737                                 }\r
4738                             }\r
4739                             if (!isFrmFound) {\r
4740                                 value[arry].FromTime = scope.fromtime[0].value;\r
4741                             }\r
4742                             for (var tocount in scope.totime) {\r
4743                                 if (scope.totime[tocount].value === value[arry].ToTime) {\r
4744                                     isToFound = true;\r
4745                                     break;\r
4746                                 }\r
4747                             }\r
4748                             if (!isToFound) {\r
4749                                 value[arry].ToTime = scope.totime[0].value;\r
4750                             }\r
4751 \r
4752                             if (typeof value[arry].preEnabled === 'boolean' && value[arry].preEnabled) {\r
4753                                 value[arry].preEnabled = true;\r
4754                             } else {\r
4755                                 value[arry].preEnabled = false;\r
4756                             }\r
4757                             \r
4758                             scope.validatedCustomPreselect[day] = {};\r
4759                             scope.validatedCustomPreselect[day].FromTime = value[arry].FromTime;\r
4760                             scope.validatedCustomPreselect[day].ToTime = value[arry].ToTime;\r
4761 \r
4762                             //for IE8 Fix\r
4763                             if (parseInt(arry) + 1 === value.length) {\r
4764                                 break;\r
4765                             }\r
4766                         }\r
4767                     }\r
4768                 } else {\r
4769                     var isOptionFound = false;\r
4770                     for (var optcount in scope.options) {\r
4771                         if (scope.options[optcount] === value.day) {\r
4772                             isOptionFound = true;\r
4773                             break;\r
4774                         }\r
4775                     }\r
4776                     if (!isOptionFound) {\r
4777                         value = "";\r
4778                     }\r
4779                 }\r
4780                 return value;\r
4781             };\r
4782 \r
4783             scope.selectPrevNextValue = function ($event, arrayValues, currValue) {\r
4784 \r
4785                 var value;\r
4786                 var index = 0;\r
4787                 if ($event.keyCode === 38) {\r
4788                     value = -1;\r
4789                 } else if ($event.keyCode === 40) {\r
4790                     value = 1;\r
4791                 } else {\r
4792                     return currValue;\r
4793                 }\r
4794 \r
4795                 if (arrayValues.indexOf(currValue) !== -1) {\r
4796                     index = arrayValues.indexOf(currValue) + value;\r
4797                 } else {\r
4798                     for (var count in arrayValues) {\r
4799                         if (arrayValues[count].value === currValue) {\r
4800                             index = parseInt(count) + value;\r
4801                             break;\r
4802                         }\r
4803                     }\r
4804                 }\r
4805 \r
4806                 if (index === arrayValues.length) {\r
4807                     index = index - 1;\r
4808                 } else if (index === -1) {\r
4809                     index = index + 1;\r
4810                 }\r
4811 \r
4812                 $event.preventDefault();\r
4813                 if (arrayValues[index].value) {\r
4814                     return arrayValues[index].value;\r
4815                 } else {\r
4816                     return arrayValues[index];\r
4817                 }\r
4818             };\r
4819 \r
4820             scope.showDropdown = function () {\r
4821                 scope.showlist = !scope.showlist;\r
4822                 flag = !flag;\r
4823             };\r
4824 \r
4825             scope.showfromDayDropdown = function (value) {\r
4826                 //close dropdown if any other From drop down is opened\r
4827                 for (count in scope.FrtimeListDay) {\r
4828                     if (count !== value && scope.FrtimeListDay[count]) {\r
4829                         scope.FrtimeListDay[count] = false;\r
4830                     }\r
4831                 }\r
4832                 for (count in scope.TotimeListDay) {\r
4833                     if (scope.TotimeListDay[count]) {\r
4834                         scope.TotimeListDay[count] = false;\r
4835                     }\r
4836                 }\r
4837                 scope.FrtimeListDay[value] = !scope.FrtimeListDay[value];\r
4838                 flag = !flag;\r
4839                 scope.showlist = false;\r
4840 \r
4841                 //save model value so we can close current dropdown on click of other part of the document\r
4842                 if (scope.FrtimeListDay[value]) {\r
4843                     scope.isFromDropDownOpen = true;\r
4844                     dropDownOpenValue = value;\r
4845                 } else {\r
4846                     scope.isFromDropDownOpen = false;\r
4847                 }\r
4848 \r
4849                 $timeout(function () {\r
4850                     if (scope.FrtimeListDay[value]) {\r
4851                         var daysContainerDIV = angular.element(element)[0].querySelector(".customdays-width");\r
4852                         var containerUL = angular.element(daysContainerDIV.querySelector('.select2-container-active')).parent()[0].querySelector("ul");\r
4853                         var selectedElemTopPos = angular.element(containerUL.querySelector('.selectedItemInDropDown'))[0].offsetTop;\r
4854                         angular.element(containerUL)[0].scrollTop = selectedElemTopPos;\r
4855                     }\r
4856                 });\r
4857             };\r
4858 \r
4859             scope.showtoDayDropdown = function (value) {\r
4860                 //close dropdown if any other To drop down is opened\r
4861                 for (count in scope.TotimeListDay) {\r
4862                     if (count !== value && scope.TotimeListDay[count]) {\r
4863                         scope.TotimeListDay[count] = false;\r
4864                     }\r
4865                 }\r
4866                 for (count in scope.FrtimeListDay) {\r
4867                     if (scope.FrtimeListDay[count]) {\r
4868                         scope.FrtimeListDay[count] = false;\r
4869                     }\r
4870                 }\r
4871                 scope.TotimeListDay[value] = !scope.TotimeListDay[value];\r
4872                 flag = !flag;\r
4873                 scope.showlist = false;\r
4874 \r
4875                 //save model value so we can close current dropdown on click of other part of the document\r
4876                 if (scope.TotimeListDay[value]) {\r
4877                     scope.isToDropDownOpen = true;\r
4878                     dropDownOpenValue = value;\r
4879 \r
4880                 } else {\r
4881                     scope.isToDropDownOpen = false;\r
4882                 }\r
4883 \r
4884                 $timeout(function () {\r
4885                     if (scope.TotimeListDay[value]) {\r
4886                         var daysContainerDIV = angular.element(element)[0].querySelector(".customdays-width");\r
4887                         var containerUL = angular.element(daysContainerDIV.querySelector('.select2-container-active')).parent()[0].querySelector("ul");\r
4888                         var selectedElemTopPos = angular.element(containerUL.querySelector('.selectedItemInDropDown'))[0].offsetTop;\r
4889                         angular.element(containerUL)[0].scrollTop = selectedElemTopPos;\r
4890                     }\r
4891                 });\r
4892             };\r
4893 \r
4894             scope.selectFromDayOption = function (day, value) {\r
4895                 scope.selectedFromOption[day] = value;\r
4896                 scope.FrtimeList[day].value = value;\r
4897                 scope.FrtimeListDay[day] = false;\r
4898                 scope.isFromDropDownOpen = false;\r
4899             };\r
4900 \r
4901             scope.selectToDayOption = function (day, value) {\r
4902                 scope.selectedToOption[day] = value;\r
4903                 scope.TotimeList[day].value = value;\r
4904                 scope.TotimeListDay[day] = false;\r
4905                 scope.isToDropDownOpen = false;\r
4906             };\r
4907 \r
4908             scope.addSelectedValue = function (value, fromtime, totime) {\r
4909                 var count, len;\r
4910                 if (scope.daysList[value] !== undefined && !scope.daysList[value]) {\r
4911                     for (count = 0, len = scope.customTime.length; count < len; count++) {\r
4912                         if (scope.customTime[count].day === value) {\r
4913                             if (scope.uncheckedFromTime) {\r
4914                                 scope.selectedFromOption[scope.customTime[count].day] = scope.uncheckedFromTime;\r
4915                             } else {\r
4916                                 scope.selectedFromOption[scope.customTime[count].day] = scope.FrtimeList[scope.customTime[count].day].value;\r
4917                             }\r
4918 \r
4919                             if (scope.uncheckedToTime) {\r
4920                                 scope.selectedToOption[scope.customTime[count].day] = scope.uncheckedToTime;\r
4921                             } else {\r
4922                                 scope.selectedToOption[scope.customTime[count].day] = scope.TotimeList[scope.customTime[count].day].value;\r
4923                             }\r
4924 \r
4925                             scope.customTime.splice(count, 1);\r
4926                             break;\r
4927                         }\r
4928                     }\r
4929                 } else {\r
4930                     if (scope.selectedFromOption[value] === scope.uncheckedFromTime) {\r
4931 \r
4932                         if (angular.isDefined(scope.validatedCustomPreselect[value])) {\r
4933                             scope.selectedFromOption[value] = scope.validatedCustomPreselect[value].FromTime;\r
4934                             fromtime = scope.validatedCustomPreselect[value].FromTime;\r
4935                             scope.FrtimeList[value].value = scope.validatedCustomPreselect[value].FromTime;\r
4936                         } else {\r
4937                             scope.selectedFromOption[value] = scope.fromtime[0].value;\r
4938                             fromtime = scope.fromtime[0].value;\r
4939                             scope.FrtimeList[value].value = scope.fromtime[0].value;\r
4940                         }\r
4941 \r
4942                     }\r
4943 \r
4944                     if (scope.selectedToOption[value] === scope.uncheckedToTime) {\r
4945 \r
4946                         if (angular.isDefined(scope.validatedCustomPreselect[value])) {\r
4947                             scope.selectedToOption[value] = scope.validatedCustomPreselect[value].ToTime;\r
4948                             totime = scope.validatedCustomPreselect[value].ToTime;\r
4949                             scope.TotimeList[value].value = scope.validatedCustomPreselect[value].ToTime;\r
4950                         } else {\r
4951                             scope.selectedToOption[value] = scope.totime[0].value;\r
4952                             totime = scope.totime[0].value;\r
4953                             scope.TotimeList[value].value = scope.totime[0].value;\r
4954                         }\r
4955                     }\r
4956 \r
4957                     custTime["day"] = value;\r
4958                     custTime["FromTime"] = scope.FrtimeList[value].value;\r
4959                     custTime["ToTime"] = scope.TotimeList[value].value;\r
4960 \r
4961                     for (count = 0, len = scope.customTime.length; count < len; count++) {\r
4962                         if (scope.customTime[count].day === value) {\r
4963                             scope.customTime[count].FromTime = custTime["FromTime"];\r
4964                             scope.customTime[count].ToTime = custTime["ToTime"];\r
4965                             break;\r
4966                         }\r
4967                     }\r
4968                     if (count === len) {\r
4969                         var x = angular.copy(custTime);\r
4970                         scope.customTime.push(x);\r
4971                     }\r
4972                 }\r
4973                 scope.selCategory = scope.customTime;\r
4974             };\r
4975 \r
4976 \r
4977             var outsideClick = function () {\r
4978                 if (scope.showlist) {\r
4979                     scope.$apply(function () {\r
4980                         scope.showlist = false;\r
4981                     });\r
4982                 }\r
4983             };\r
4984 \r
4985             $documentBind.click('showlist', outsideClick, scope);\r
4986 \r
4987             var outsideClickFromDropdown = function () {\r
4988                 scope.$apply(function () {\r
4989                     if (scope.isFromDropDownOpen) {\r
4990                         scope.FrtimeListDay[dropDownOpenValue] = false;\r
4991                         scope.isFromDropDownOpen = false;\r
4992                     }\r
4993                 });\r
4994             };\r
4995 \r
4996             $documentBind.click('isFromDropDownOpen', outsideClickFromDropdown, scope);\r
4997 \r
4998             var outsideClickToDropdown = function () {\r
4999                 scope.$apply(function () {\r
5000                     if (scope.isToDropDownOpen) {\r
5001                         scope.TotimeListDay[dropDownOpenValue] = false;\r
5002                         scope.isToDropDownOpen = false;\r
5003                     }\r
5004                 });\r
5005             };\r
5006 \r
5007             $documentBind.click('isToDropDownOpen', outsideClickToDropdown, scope);\r
5008 \r
5009             scope.selectOption = function (sItem) {\r
5010 \r
5011                 if (sItem === hourpickerConfig.customOption) {\r
5012                     scope.showDaysSelector = true;\r
5013                     scope.selCategory = scope.customTime;\r
5014                 } else {\r
5015                     scope.showDaysSelector = false;\r
5016                     var fromTime = /[0-9]\s?am/i.exec(sItem);\r
5017                     var toTime = /[0-9]\s?pm/i.exec(sItem);\r
5018                     scope.selCategory = {\r
5019                         day: sItem,\r
5020                         FromTime: fromTime === null ? 'NA' : fromTime[0],\r
5021                         ToTime: toTime === null ? 'NA' : toTime[0]\r
5022                     };\r
5023                 }\r
5024 \r
5025                 scope.showlist = false;\r
5026                 flag = false;\r
5027                 scope.selectedOption = sItem;\r
5028             };\r
5029         }\r
5030     };\r
5031 }])\r
5032 \r
5033 .directive('attHourpickerValidator', ['hourpickerConfig', function (hourpickerConfig) {\r
5034     return {\r
5035         restrict: 'A',\r
5036         require: ['attHourpicker', 'ngModel'],\r
5037         link: function (scope, element, attr, ctrl) {\r
5038 \r
5039             var attHourpickerCtrl = ctrl[0];\r
5040             var ngModelCtrl = ctrl[1];\r
5041 \r
5042             //required format [h:MM tt] like '1:10 PM'\r
5043             var convertTimeStrngToMilitaryFormat = function (time) {\r
5044                 var hours = Number(time.match(/^(\d+)/)[1]);\r
5045                 var minutes = Number(time.match(/:(\d+)/)[1]);\r
5046                 var AMPM = (time.match(/\s(.*)$/)[1]).toUpperCase();\r
5047                 if (AMPM === 'PM' && hours < 12) {\r
5048                     hours = hours + 12;\r
5049                 }\r
5050                 if (AMPM === 'AM' && hours === 12) {\r
5051                     hours = hours - 12;\r
5052                 }\r
5053                 var sHours = hours.toString();\r
5054                 var sMinutes = minutes.toString();\r
5055                 if (hours < 10) {\r
5056                     sHours = '0' + sHours;\r
5057                 }\r
5058                 if (minutes < 10) {\r
5059                     sMinutes = '0' + sMinutes;\r
5060                 }\r
5061                 return parseInt(sHours + sMinutes, 10);\r
5062             };\r
5063 \r
5064             var compareTimeStrings = function (fromTimeString, toTimeString) {\r
5065                 var fromMilitaryTime = convertTimeStrngToMilitaryFormat(fromTimeString);\r
5066                 var toMilitaryTime = convertTimeStrngToMilitaryFormat(toTimeString);\r
5067                 return (toMilitaryTime - fromMilitaryTime);\r
5068             };\r
5069 \r
5070             var validateCustomData = function (finalDataModal) {\r
5071 \r
5072                 if (attHourpickerCtrl.getSelectedOption() === hourpickerConfig.customOption) {\r
5073 \r
5074                     var errorDaysCount = 0;\r
5075 \r
5076                     for (var item in finalDataModal) {\r
5077                         if (finalDataModal.hasOwnProperty(item)) {\r
5078                             if (compareTimeStrings(finalDataModal[item].FromTime, finalDataModal[item].ToTime) <= 0) {\r
5079                                 attHourpickerCtrl.setToTimeErrorDay(finalDataModal[item].day, true);\r
5080                                 errorDaysCount++;\r
5081                             } else {\r
5082                                 attHourpickerCtrl.setToTimeErrorDay(finalDataModal[item].day, false);\r
5083                             }\r
5084                         }\r
5085                     }\r
5086 \r
5087                     if (errorDaysCount > 0) {\r
5088                         //validation error\r
5089                         ngModelCtrl.$setValidity('validationStatus', false);\r
5090                         return [];\r
5091                     } else {\r
5092                         //validation successful\r
5093                         ngModelCtrl.$setValidity('validationStatus', true);\r
5094                         return finalDataModal;\r
5095                     }\r
5096                 } else {\r
5097                     //default case no validation\r
5098                     ngModelCtrl.$setValidity('validationStatus', true);\r
5099                     return finalDataModal;\r
5100                 }\r
5101 \r
5102             };\r
5103 \r
5104             ngModelCtrl.$parsers.unshift(validateCustomData);\r
5105         }\r
5106     };\r
5107 }]);\r
5108 angular.module('att.abs.iconButtons', [])\r
5109         .constant('buttonConfig', {\r
5110             activeClass: 'active--button',\r
5111             toggleEvent: 'click'\r
5112         })\r
5113         .directive('attIconBtnRadio', ['buttonConfig', function(buttonConfig) {\r
5114                 var activeClass = buttonConfig.activeClass || 'active--button';\r
5115                 var toggleEvent = buttonConfig.toggleEvent || 'click';\r
5116                 return {\r
5117                     require: 'ngModel',\r
5118                     link: function(scope, element, attrs, ngModelCtrl) {\r
5119                         element.attr("tabindex","0");\r
5120                         element.append("<span class='hidden-spoken'>"+attrs.attIconBtnRadio+"</span>");\r
5121                         //model -> UI\r
5122                         ngModelCtrl.$render = function() {\r
5123                             element.parent().toggleClass(activeClass, angular.equals(ngModelCtrl.$modelValue, attrs.attIconBtnRadio));\r
5124                         };\r
5125                         //ui->model\r
5126                         element.parent().bind(toggleEvent, function() {\r
5127                             if (!element.parent().hasClass(activeClass)) {\r
5128                                 scope.$apply(function() {\r
5129                                     ngModelCtrl.$setViewValue(attrs.attIconBtnRadio);\r
5130                                     ngModelCtrl.$render();\r
5131                                 });\r
5132                             }\r
5133                         });\r
5134                     }\r
5135                 };\r
5136             }])\r
5137         .directive('attIconBtnCheckbox', ['buttonConfig', function(buttonConfig) {\r
5138                 var activeClass = buttonConfig.activeClass || 'active--button';\r
5139                 var toggleEvent = buttonConfig.toggleEvent || 'click';\r
5140                 return {\r
5141                     require: 'ngModel',\r
5142                     link: function(scope, element, attrs, ngModelCtrl) {\r
5143                         element.attr("tabindex","0");\r
5144                         element.append("<span class='hidden-spoken'>"+attrs.attIconBtnCheckbox+"</span>");\r
5145                         function getTrueValue() {\r
5146                             var trueValue = scope.$eval(attrs.btnCheckboxTrue);\r
5147                             return angular.isDefined(trueValue) ? trueValue : true;\r
5148                         }\r
5149                         function getFalseValue() {\r
5150                             var falseValue = scope.$eval(attrs.btnCheckboxFalse);\r
5151                             return angular.isDefined(falseValue) ? falseValue : false;\r
5152                         }\r
5153                         //model -> UI\r
5154                         ngModelCtrl.$render = function() {\r
5155                             element.parent().toggleClass(activeClass, angular.equals(ngModelCtrl.$modelValue, getTrueValue()));\r
5156                         };\r
5157                         //ui->model\r
5158                         element.parent().bind(toggleEvent, function() {\r
5159                             scope.$apply(function() {\r
5160                                 ngModelCtrl.$setViewValue(element.parent().hasClass(activeClass) ? getFalseValue() : getTrueValue());\r
5161                                 ngModelCtrl.$render();\r
5162                             });\r
5163                         });\r
5164                     }\r
5165                 };\r
5166             }]);\r
5167 \r
5168 angular.module('att.abs.links', ['ngSanitize'])\r
5169         .directive('attLink', [function() {\r
5170                 return {\r
5171                     restrict: 'A',\r
5172                     link: function(scope, elem) {\r
5173                         elem.addClass('link');\r
5174                         if(!(elem.attr('href'))){\r
5175                             elem.attr("tabindex", "0");\r
5176                         }\r
5177                     }\r
5178                 };\r
5179             }])\r
5180         .directive('attLinkVisited', [function() {\r
5181                 return {\r
5182                     restrict: 'A',\r
5183                     link: function(scope, elem) {\r
5184                         elem.addClass('link--visited');\r
5185                         if(!(elem.attr('href'))){\r
5186                             elem.attr("tabindex", "0");\r
5187                         }\r
5188                     }\r
5189                 };\r
5190             }])\r
5191         .directive('attReadmore', ['$timeout',function($timeout) {\r
5192                 return {\r
5193                     restrict: 'A',\r
5194                     scope: {\r
5195                         lines:"@noOfLines",\r
5196                         textModel: "=",\r
5197                         //attribute to use readmore inside accordion\r
5198                         isOpen: "="\r
5199                     },\r
5200                     templateUrl: 'app/scripts/ng_js_att_tpls/links/readMore.html',\r
5201                     link: function(scope, elem) {\r
5202                         var height = 1;\r
5203                         scope.$watch('textModel', function(val){\r
5204                             if(!val){\r
5205                                 scope.textToDisplay = '';\r
5206                                 scope.readMoreLink = false;\r
5207                                 scope.readLessLink = false;\r
5208                                 scope.readFlag = false;\r
5209                             }\r
5210                             else{\r
5211                                 if (typeof String.prototype.trim !== 'function') {\r
5212                                     String.prototype.trim = function() {\r
5213                                        return this.replace(/^\s+|\s+$/g, '');\r
5214                                     };\r
5215                                 }\r
5216                                 scope.textToDisplay = val.trim();\r
5217                                 scope.readFlag = true;\r
5218                                 $timeout(function() {\r
5219                                     var readElem = elem[0].children[0].children[0];\r
5220                                     if(height===1){\r
5221                                         if(window.getComputedStyle){\r
5222                                             height = parseInt(scope.lines) * parseFloat(window.getComputedStyle(readElem,null).getPropertyValue("height"));\r
5223                                         }\r
5224                                         else {\r
5225                                             height = parseInt(scope.lines) * parseFloat(readElem.currentStyle.height);\r
5226                                         }\r
5227                                         scope.elemHeight = height;\r
5228                                         scope.readLinkStyle = {'height': scope.elemHeight + 'px'};\r
5229                                     }\r
5230                                 });\r
5231                                 scope.readMoreLink = true;\r
5232                                 scope.readLessLink = false;\r
5233                             }\r
5234                         });\r
5235                         // Code to use readmore inside accordion\r
5236                         var parentElem = elem.parent();\r
5237                         if (parentElem.hasClass('att-accordion__body')) {\r
5238                             scope.$watch('isOpen', function(val) {\r
5239                                 if (!val) {\r
5240                                     scope.readMoreLink = true;\r
5241                                     scope.readLessLink = false;\r
5242                                     scope.readLinkStyle = {'height': scope.elemHeight + 'px'};\r
5243                                     scope.readFlag = true;\r
5244                                 }\r
5245                             });\r
5246                         }\r
5247                         scope.readMore = function() {\r
5248                             scope.readMoreLink = false;\r
5249                             scope.readLessLink = true;\r
5250                             scope.readLinkStyle = {'height': 'auto'};\r
5251                             scope.readFlag = false;\r
5252                             var moreLink = angular.element(elem).children().eq(1).find('a')[0];\r
5253                             $timeout(function()\r
5254                              {\r
5255                                 moreLink.focus();\r
5256                              });\r
5257                         };\r
5258                         scope.readLess = function() {\r
5259                             scope.readMoreLink = true;\r
5260                             scope.readLessLink = false;\r
5261                             scope.readLinkStyle = {'height': scope.elemHeight + 'px'};\r
5262                             scope.readFlag = true;\r
5263                             var readLessLink = angular.element(elem).children().eq(0).find('a')[0];\r
5264                             $timeout(function()\r
5265                              {\r
5266                                 readLessLink.focus();\r
5267                              });\r
5268                         };\r
5269                     }\r
5270                 };\r
5271             }])\r
5272         .directive('attLinksList', [function() {\r
5273                 return {\r
5274                     restrict: 'A',\r
5275                     controller: function() {\r
5276                     },\r
5277                     link: function(scope, elem) {\r
5278                         elem.addClass('links-list');\r
5279                     }\r
5280                 };\r
5281             }])\r
5282         .directive('attLinksListItem', [function() {\r
5283                 return {\r
5284                     restrict: 'A',\r
5285                     require: '^attLinksList',\r
5286                     link: function(scope, elem) {\r
5287                         elem.addClass('links-list__item');\r
5288                         if(!(elem.attr('href'))){\r
5289                             elem.attr("tabindex", "0");\r
5290                         }\r
5291                     }\r
5292                 };\r
5293             }]);\r
5294 angular.module('att.abs.loading', [])\r
5295         .directive('attLoading', ['$window',function($window) {\r
5296                 return {\r
5297                     restrict: 'A',\r
5298                     replace: true,\r
5299                     scope: {\r
5300                         icon: '@attLoading',\r
5301                         progressStatus: '=?',\r
5302                         colorClass: '=?'\r
5303                     },\r
5304                     templateUrl: 'app/scripts/ng_js_att_tpls/loading/loading.html',\r
5305                     link: function(scope, element) {\r
5306                         var progressvalue = scope.progressStatus;\r
5307                         scope.progressStatus = Math.min(100, Math.max(0, progressvalue));\r
5308                         if($window.navigator.userAgent.indexOf("MSIE 8.")!==-1){\r
5309                             var shiftX = 0, shiftY = scope.progressStatus * 36;\r
5310                             element.css({\r
5311                                 'background-position-x' : shiftX,\r
5312                                 'background-position-y' : -shiftY\r
5313                             });\r
5314                         }\r
5315                     }\r
5316             };\r
5317         }]);\r
5318 angular.module('att.abs.modal', ['att.abs.utilities'])\r
5319 /**\r
5320  * A helper, internal data structure that acts as a map but also allows getting / removing\r
5321  * elements in the LIFO order\r
5322  */\r
5323   .factory('$$stackedMap', function () {\r
5324     return {\r
5325       createNew: function () {\r
5326         var stack = [];\r
5327 \r
5328         return {\r
5329           add: function (key, value) {\r
5330             stack.push({\r
5331               key: key,\r
5332               value: value\r
5333             });\r
5334           },\r
5335           get: function (key) {\r
5336             for (var i = 0; i < stack.length; i++) {\r
5337               if (key === stack[i].key) {\r
5338                 return stack[i];\r
5339               }\r
5340             }\r
5341           },\r
5342           keys: function() {\r
5343             var keys = [];\r
5344             for (var i = 0; i < stack.length; i++) {\r
5345               keys.push(stack[i].key);\r
5346             }\r
5347             return keys;\r
5348           },\r
5349           top: function () {\r
5350             return stack[stack.length - 1];\r
5351           },\r
5352           remove: function (key) {\r
5353             var idx = -1;\r
5354             for (var i = 0; i < stack.length; i++) {\r
5355               if (key === stack[i].key) {\r
5356                 idx = i;\r
5357                 break;\r
5358               }\r
5359             }\r
5360             return stack.splice(idx, 1)[0];\r
5361           },\r
5362           removeTop: function () {\r
5363             return stack.splice(stack.length - 1, 1)[0];\r
5364           },\r
5365           length: function () {\r
5366             return stack.length;\r
5367           }\r
5368         };\r
5369       }\r
5370     };\r
5371   })\r
5372 \r
5373 /**\r
5374  * A helper directive for the $modal service. It creates a backdrop element.\r
5375  */\r
5376   .directive('modalBackdrop', ['$timeout', function ($timeout) {\r
5377     return {\r
5378       restrict: 'EA',\r
5379       replace: true,\r
5380       templateUrl: 'app/scripts/ng_js_att_tpls/modal/backdrop.html',\r
5381       link: function (scope) {\r
5382         scope.animate = false;\r
5383         //trigger CSS transitions\r
5384         $timeout(function () {\r
5385           scope.animate = true;\r
5386         });\r
5387     }\r
5388     };\r
5389   }])\r
5390 \r
5391   .directive('modalWindow', ['$modalStack','$timeout','$document', function ($modalStack,$timeout,$document) {\r
5392     return {\r
5393       restrict: 'EA',\r
5394       scope: {\r
5395         index: '@',\r
5396                 modalTitle: '@?'\r
5397       },\r
5398       replace: true,\r
5399       transclude: true,\r
5400       templateUrl: 'app/scripts/ng_js_att_tpls/modal/window.html',\r
5401       link: function (scope, element, attrs) {\r
5402         scope.windowClass = attrs.windowClass || '';\r
5403                 if (attrs['modalTitle'] && attrs['modalTitle']!=="") {\r
5404                         element[0].setAttribute('aria-label', attrs['modalTitle']);\r
5405                         element[0].removeAttribute('modal-title');\r
5406                 }\r
5407         $timeout(function () {\r
5408             // trigger CSS transitions\r
5409             scope.focusModalFlag = true;\r
5410             scope.animate = true;\r
5411         });\r
5412                 $document.on('focus keydown', function(e){\r
5413                     if (e.which ===9) {\r
5414                         String.prototype.contains = function(it) {\r
5415                             return this.indexOf(it) !== -1;\r
5416                         };\r
5417                         if (element[0] !== e.target && !element[0].contains( e.target )) {\r
5418                                 element[0].focus();\r
5419                         }\r
5420                         }\r
5421                 });\r
5422         scope.close = function (evt) {\r
5423             var modal = $modalStack.getTop();\r
5424             if (modal && modal.value.backdrop && modal.value.backdrop != 'static'  && (evt.target === evt.currentTarget)) {\r
5425             // Check if preventDefault exists due to lack of support for IE8\r
5426             if (evt.preventDefault) {\r
5427               evt.preventDefault();\r
5428               evt.stopPropagation();\r
5429           } else {\r
5430               evt.returnValue = false;\r
5431             }\r
5432             $modalStack.dismiss(modal.key, 'backdrop click');\r
5433           }\r
5434         };\r
5435       }\r
5436     };\r
5437   }])\r
5438 \r
5439   .factory('$modalStack', ['$document', '$compile', '$rootScope', '$$stackedMap', 'events', 'keymap',\r
5440     function ($document, $compile, $rootScope, $$stackedMap, events, keymap) {\r
5441       var OPENED_MODAL_CLASS = 'modal-open';\r
5442       var backdropjqLiteEl, backdropDomEl;\r
5443       var backdropScope = $rootScope.$new(true);\r
5444       var openedWindows = $$stackedMap.createNew();\r
5445       var $modalStack = {};\r
5446       var modalLaunchingElement = undefined;\r
5447       function backdropIndex() {\r
5448         var topBackdropIndex = -1;\r
5449         var opened = openedWindows.keys();\r
5450         for (var i = 0; i < opened.length; i++) {\r
5451           if (openedWindows.get(opened[i]).value.backdrop) {\r
5452             topBackdropIndex = i;\r
5453           }\r
5454         }\r
5455         return topBackdropIndex;\r
5456       }\r
5457 \r
5458       $rootScope.$watch(backdropIndex, function(newBackdropIndex){\r
5459         backdropScope.index = newBackdropIndex;\r
5460       });\r
5461 \r
5462       function removeModalWindow(modalInstance) {\r
5463 \r
5464         var body = $document.find('body').eq(0);\r
5465         var html = $document.find('html').eq(0);\r
5466         var modalWindow = openedWindows.get(modalInstance).value;\r
5467         //clean up the stack\r
5468         openedWindows.remove(modalInstance);\r
5469         ////remove window DOM element\r
5470         modalWindow.modalDomEl.remove();\r
5471         body.toggleClass(OPENED_MODAL_CLASS, openedWindows.length() > 0);\r
5472         html.css({overflow: 'scroll'});\r
5473 \r
5474         //remove backdrop if no longer needed\r
5475         if (backdropDomEl && backdropIndex() == -1) {\r
5476           backdropDomEl.remove();\r
5477           backdropDomEl = undefined;\r
5478         }\r
5479         //destroy scope\r
5480         modalWindow.modalScope.$destroy();\r
5481           \r
5482         // Shift focus\r
5483         if (angular.isDefined(modalLaunchingElement) && modalLaunchingElement != null) {\r
5484             modalLaunchingElement.focus();\r
5485         }\r
5486       }\r
5487       $document.bind('keydown', function (evt) {\r
5488         var modal;\r
5489         if (evt.which === 27) {\r
5490           modal = openedWindows.top();\r
5491           if (modal && modal.value.keyboard) {\r
5492             $rootScope.$apply(function () {\r
5493               $modalStack.dismiss(modal.key);\r
5494             });\r
5495           }\r
5496         } else if (evt.keyCode === keymap.KEY.BACKSPACE) {\r
5497           var doPrevent = false;\r
5498           var d = evt.srcElement || evt.target;\r
5499           var type;\r
5500           if (d.type === undefined) { \r
5501                 doPrevent = true;\r
5502           } else if (d.tagName.toUpperCase() === 'INPUT' && \r
5503             ( (type = d.type.toUpperCase()) === 'TEXT' || \r
5504               type === 'PASSWORD' || \r
5505               type === 'FILE' ||\r
5506               type === 'SEARCH' ||\r
5507               type === 'EMAIL' ||\r
5508               type === 'NUMBER' ||\r
5509               type === 'DATE' ||\r
5510               type === 'TEL' ||\r
5511               type === 'URL' ||\r
5512               type === 'TIME')\r
5513             || d.tagName.toUpperCase() === 'TEXTAREA') {\r
5514                 doPrevent = d.readOnly || d.disabled;\r
5515           } else {\r
5516             doPrevent = true;\r
5517           }\r
5518           if (doPrevent) {\r
5519               events.preventDefault(evt);\r
5520           }\r
5521         }\r
5522       });\r
5523 \r
5524       $modalStack.open = function (modalInstance, modal) {\r
5525           openedWindows.add(modalInstance, {\r
5526           deferred: modal.deferred,\r
5527           modalScope: modal.scope,\r
5528           backdrop: modal.backdrop,\r
5529           keyboard: modal.keyboard\r
5530         });\r
5531         \r
5532         //Before opening modal, find the focused element\r
5533         modalLaunchingElement = document.activeElement;\r
5534         \r
5535         var body = $document.find('body').eq(0);\r
5536         var html = $document.find('html').eq(0);\r
5537 \r
5538         if (backdropIndex() >= 0 && !backdropDomEl) {\r
5539             backdropjqLiteEl = angular.element('<div modal-backdrop></div>');\r
5540             backdropDomEl = $compile(backdropjqLiteEl)(backdropScope);\r
5541             body.append(backdropDomEl);\r
5542         }\r
5543         var angularDomEl = angular.element('<div modal-window></div>');\r
5544         angularDomEl.attr('window-class', modal.windowClass);\r
5545         angularDomEl.attr('index', openedWindows.length() - 1);\r
5546                 angularDomEl.attr('modal-title', modal.modalTitle);\r
5547         angularDomEl.html(modal.content);\r
5548 \r
5549         var modalDomEl = $compile(angularDomEl)(modal.scope);\r
5550         openedWindows.top().value.modalDomEl = modalDomEl;\r
5551         body.append(modalDomEl);\r
5552         body.addClass(OPENED_MODAL_CLASS);\r
5553         html.css({overflow: 'hidden'});\r
5554       };\r
5555 \r
5556       $modalStack.close = function (modalInstance, result) {\r
5557         var modal = openedWindows.get(modalInstance);\r
5558         if (modal) {\r
5559           modal.value.deferred.resolve(result);\r
5560           removeModalWindow(modalInstance);\r
5561         }\r
5562       };\r
5563 \r
5564       $modalStack.dismiss = function (modalInstance, reason) {\r
5565         var modalWindow = openedWindows.get(modalInstance).value;\r
5566         if (modalWindow) {\r
5567           modalWindow.deferred.reject(reason);\r
5568           removeModalWindow(modalInstance);\r
5569         }\r
5570       };\r
5571 \r
5572       $modalStack.getTop = function () {\r
5573         return openedWindows.top();\r
5574       };\r
5575 \r
5576       return $modalStack;\r
5577     }])\r
5578 \r
5579   .provider('$modal', function () {\r
5580 \r
5581     var $modalProvider = {\r
5582       options: {\r
5583         //can be also false or 'static'\r
5584         backdrop: true,\r
5585         keyboard: true\r
5586       },\r
5587       $get: ['$injector', '$rootScope', '$q', '$http', '$templateCache', '$controller', '$modalStack',\r
5588         function ($injector, $rootScope, $q, $http, $templateCache, $controller, $modalStack) {\r
5589             var $modal = {};\r
5590             function getTemplatePromise(options) {\r
5591             return options.template ? $q.when(options.template) :\r
5592               $http.get(options.templateUrl, {cache: $templateCache}).then(function (result) {\r
5593                 return result.data;\r
5594               });\r
5595           }\r
5596 \r
5597           function getResolvePromises(resolves) {\r
5598             var promisesArr = [];\r
5599             angular.forEach(resolves, function (value) {\r
5600               if (angular.isFunction(value) || angular.isArray(value)) {\r
5601                 promisesArr.push($q.when($injector.invoke(value)));\r
5602               }\r
5603             });\r
5604             return promisesArr;\r
5605           }\r
5606           $modal.open = function (modalOptions) {\r
5607             var modalResultDeferred = $q.defer();\r
5608             var modalOpenedDeferred = $q.defer();\r
5609 \r
5610             //prepare an instance of a modal to be injected into controllers and returned to a caller\r
5611             var modalInstance = {\r
5612               result: modalResultDeferred.promise,\r
5613               opened: modalOpenedDeferred.promise,\r
5614               close: function (result) {\r
5615                 $modalStack.close(modalInstance, result);\r
5616               },\r
5617               dismiss: function (reason) {\r
5618                 $modalStack.dismiss(modalInstance, reason);\r
5619               }\r
5620             };\r
5621             //merge and clean up options\r
5622             modalOptions = angular.extend({}, $modalProvider.options, modalOptions);\r
5623             modalOptions.resolve = modalOptions.resolve || {};\r
5624 \r
5625             //verify options\r
5626             if (!modalOptions.template && !modalOptions.templateUrl) {\r
5627               throw new Error('One of template or templateUrl options is required.');\r
5628             }\r
5629 \r
5630             var templateAndResolvePromise =\r
5631               $q.all([getTemplatePromise(modalOptions)].concat(getResolvePromises(modalOptions.resolve)));\r
5632               templateAndResolvePromise.then(function(tplAndVars) {\r
5633               var modalScope = (modalOptions.scope || $rootScope).$new();\r
5634               modalScope.$close = modalInstance.close;\r
5635               modalScope.$dismiss = modalInstance.dismiss;\r
5636 \r
5637               var ctrlInstance, ctrlLocals = {};\r
5638               var resolveIter = 1;\r
5639 \r
5640               //controllers\r
5641               if (modalOptions.controller) {\r
5642                 ctrlLocals.$scope = modalScope;\r
5643                 ctrlLocals.$modalInstance = modalInstance;\r
5644                 angular.forEach(modalOptions.resolve, function (value, key) {\r
5645                   ctrlLocals[key] = tplAndVars[resolveIter++];\r
5646                 });\r
5647 \r
5648                 ctrlInstance = $controller(modalOptions.controller, ctrlLocals);\r
5649               }\r
5650 \r
5651               $modalStack.open(modalInstance, {\r
5652                 scope: modalScope,\r
5653                 deferred: modalResultDeferred,\r
5654                 content: tplAndVars[0],\r
5655                 backdrop: modalOptions.backdrop,\r
5656                 keyboard: modalOptions.keyboard,\r
5657                 windowClass: modalOptions.windowClass,\r
5658                                 modalTitle: modalOptions.modalTitle\r
5659               });\r
5660 \r
5661             }, function(reason) {\r
5662               modalResultDeferred.reject(reason);\r
5663             });\r
5664 \r
5665             templateAndResolvePromise.then(function () {\r
5666               modalOpenedDeferred.resolve(true);\r
5667             }, function () {\r
5668               modalOpenedDeferred.reject(false);\r
5669             });\r
5670 \r
5671             return modalInstance;\r
5672           };\r
5673 \r
5674           return $modal;\r
5675         }]\r
5676     };\r
5677 \r
5678     return $modalProvider;\r
5679   })\r
5680 \r
5681 .directive("simpleModal", ["$modal", function($modal) {\r
5682         return {\r
5683             restrict: 'EA',\r
5684             scope: {\r
5685                 simpleModal: '@',\r
5686                 backdrop:'@',\r
5687                 keyboard:'@',\r
5688                 modalOk:'&',\r
5689                 modalCancel:'&',\r
5690                 windowClass:'@',\r
5691                 controller:'@',\r
5692                                 modalTitle: '@?'\r
5693             },\r
5694             link: function(scope, elm) {\r
5695                 elm.bind('click', function(ev) {\r
5696                     ev.preventDefault();\r
5697                     if (angular.isDefined(elm.attr("href")) && elm.attr("href") !== "") {\r
5698                         scope.simpleModal = elm.attr("href");\r
5699                     }\r
5700 \r
5701                     scope.backdrop === "false" ? scope.backdropclick = 'static' : scope.backdropclick = true;\r
5702                     scope.keyboard === "false" ? scope.keyboardev = false : scope.keyboardev = true;\r
5703 \r
5704                     $modal.open({\r
5705                         templateUrl: scope.simpleModal,\r
5706                         backdrop:scope.backdropclick,\r
5707                         keyboard:scope.keyboardev,\r
5708                         windowClass:scope.windowClass,\r
5709                         controller: scope.controller,\r
5710                                                 modalTitle: scope.modalTitle\r
5711                     }).result.then(scope.modalOk, scope.modalCancel);\r
5712                 });\r
5713             }\r
5714         };\r
5715     }])\r
5716 \r
5717 .directive('tabbedItem', ['$modal', '$log',function ($modal, $log){\r
5718     return {\r
5719         restrict: 'AE',\r
5720         replace: true,\r
5721         scope: {\r
5722             items: "=items",\r
5723             controller: "@",\r
5724             templateId:"@",\r
5725                         modalTitle: '@?'\r
5726         },\r
5727         templateUrl: 'app/scripts/ng_js_att_tpls/modal/tabbedItem.html',\r
5728         controller: ['$scope', '$rootScope', '$attrs', function ($scope) {\r
5729                 $scope.clickTab = function (index) {\r
5730                     for (var i = 0; i < $scope.items.length; i++) {\r
5731                         if (i === index) {\r
5732                             $scope.items[i].isTabOpen = true;\r
5733                             $scope.items[i].showData = true;\r
5734                         }\r
5735                         else {\r
5736                             $scope.items[i].isTabOpen = false;\r
5737                             $scope.items[i].showData = false;\r
5738                         }\r
5739                     }\r
5740                     var modalInstance = $modal.open({\r
5741                         templateUrl: $scope.templateId,\r
5742                         controller: $scope.controller,\r
5743                         windowClass: 'tabbedOverlay_modal',\r
5744                                                 modalTitle: $scope.modalTitle,\r
5745                         resolve: {\r
5746                             items: function () {\r
5747                                 return $scope.items;\r
5748                             }\r
5749                         }\r
5750                     });\r
5751                     modalInstance.result.then(function (selectedItem) {\r
5752                         $scope.selected = selectedItem;\r
5753                     }, function () {\r
5754                         $log.info('Modal dismissed at: ' + new Date());\r
5755                     });\r
5756                 };\r
5757                 $scope.isActiveTab = function (index) {\r
5758                     return $scope.items && $scope.items[index] && $scope.items[index].isTabOpen;\r
5759                 };\r
5760             }]\r
5761                 };\r
5762 }])\r
5763 \r
5764 .directive('tabbedOverlay', [function () {\r
5765     return {\r
5766         restrict: 'AE',\r
5767         replace: true,\r
5768         scope: {\r
5769             items: "="\r
5770         },\r
5771         transclude: true,\r
5772         templateUrl: 'app/scripts/ng_js_att_tpls/modal/tabbedOverlayItem.html',\r
5773         controller: ['$scope', function ($scope) {\r
5774                 $scope.clickTab = function (index) {\r
5775                     for (var i = 0; i < $scope.items.length; i++) {\r
5776                         if (i === index) {\r
5777                             $scope.items[i].isTabOpen = true;\r
5778                             $scope.items[i].showData = true;\r
5779                         }\r
5780                         else {\r
5781                             $scope.items[i].isTabOpen = false;\r
5782                             $scope.items[i].showData = false;\r
5783                         }\r
5784                     }\r
5785                 };\r
5786                 $scope.isActiveTab = function (index) {\r
5787                     return $scope.items && $scope.items[index] && $scope.items[index].isTabOpen;\r
5788                 };\r
5789             }]\r
5790     };\r
5791 }]);\r
5792 angular.module('att.abs.pagination', ['att.abs.utilities'])\r
5793 .directive('attPagination', [ function() {\r
5794      return {\r
5795         restrict: 'EA',\r
5796         scope: {\r
5797             totalPages: '=',\r
5798             currentPage: '=',\r
5799             showInput: '=',\r
5800             clickHandler: '=?'\r
5801         },\r
5802         replace: true,\r
5803         templateUrl: 'app/scripts/ng_js_att_tpls/pagination/pagination.html',\r
5804         link: function(scope) {\r
5805             scope.focusedPage;\r
5806             scope.$watch('totalPages', function(value) {\r
5807                 if(angular.isDefined(value) && value !== null){\r
5808                     scope.pages = [];\r
5809                     if (value < 1) {\r
5810                         scope.totalPages = 1;\r
5811                         return;\r
5812                     }\r
5813                     if (value <= 7) {\r
5814                         for (var i = 1; i <= value; i++) {\r
5815                             scope.pages.push(i);\r
5816                         }\r
5817                     } else if (value > 7) {\r
5818                         var midVal = Math.ceil(value / 2);\r
5819                         scope.pages = [midVal - 1, midVal, midVal + 1];\r
5820                     }\r
5821                     currentPageChanged(1);\r
5822                 }\r
5823             });\r
5824             scope.$watch('currentPage', function(value) {\r
5825                 currentPageChanged(value);\r
5826             });\r
5827             var callbackHandler = function(num) {\r
5828                 if (angular.isFunction(scope.clickHandler)){\r
5829                     scope.clickHandler(num);\r
5830                 }\r
5831             };\r
5832             function currentPageChanged(value) {\r
5833                 if (angular.isDefined(value) && value !== null) {\r
5834                     if (!value || value < 1) {\r
5835                         value = 1;\r
5836                     }\r
5837                     if (value > scope.totalPages) {\r
5838                         value = scope.totalPages;\r
5839                     }\r
5840                     if(scope.currentPage !== value) {\r
5841                         scope.currentPage = value;\r
5842                         callbackHandler(scope.currentPage);\r
5843                     }\r
5844                     if (scope.totalPages > 7) {\r
5845                         if (value < scope.pages[0] && value > 3) {\r
5846                             scope.pages = [value, value + 1, value + 2];\r
5847                         } else if (value > scope.pages[2] && value < scope.totalPages - 2) {\r
5848                            scope.pages = [value - 2, value - 1, value];\r
5849                         } else if (value <= 3) {\r
5850                              scope.pages = [1, 2, 3];\r
5851                         } else if (value >= scope.totalPages - 2) {\r
5852                              scope.pages = [scope.totalPages - 2, scope.totalPages - 1, scope.totalPages];\r
5853                         }\r
5854                     }\r
5855                 }\r
5856             }\r
5857             scope.next = function(event) {\r
5858                 event.preventDefault();\r
5859                 if (scope.currentPage < scope.totalPages) {\r
5860                     scope.currentPage += 1;\r
5861                     callbackHandler(scope.currentPage);\r
5862                 }\r
5863             };\r
5864             scope.prev = function(event) {\r
5865                 event.preventDefault();\r
5866                 if (scope.currentPage > 1) {\r
5867                     scope.currentPage -= 1;\r
5868                     callbackHandler(scope.currentPage);\r
5869                 }\r
5870             };\r
5871             scope.selectPage = function(value, event) {\r
5872                 event.preventDefault();\r
5873                 scope.currentPage = value;\r
5874                 scope.focusedPage = value;\r
5875                 callbackHandler(scope.currentPage);\r
5876             };\r
5877             scope.checkSelectedPage = function(value) {\r
5878                 if(scope.currentPage === value) {\r
5879                     return true;\r
5880                 }\r
5881                 return false;\r
5882             };\r
5883             scope.isFocused = function(page) {\r
5884                  return scope.focusedPage === page;\r
5885             };\r
5886         }\r
5887     };\r
5888 }]);\r
5889 \r
5890 angular.module('att.abs.paneSelector',['att.abs.utilities'])\r
5891 .constant('paneGroupConstants',{\r
5892     SIDE_WIDTH_DEFAULT: '33%',\r
5893     INNER_PANE_DEFAULT: '67%',\r
5894     SIDE_PANE_ID: 'sidePane',\r
5895     NO_DRILL_DOWN: 'none'\r
5896 })\r
5897 .factory('animation', function(){\r
5898     return TweenLite;\r
5899 }).directive('attPaneAccessibility',['keymap','$window',function(keymap,$window) {\r
5900         return{\r
5901             restrict: 'A',\r
5902             require: ['^?sidePane','^?innerPane'],\r
5903             link: function (scope, elem,attr,ctrl) {\r
5904                 var sidepaneCtrl = ctrl[0],innerPaneCtrl = ctrl[1],ieFlag=false;\r
5905                 scope.ie = (function () {\r
5906                     var undef,v = 3,div = document.createElement('div'),\r
5907                             all = div.getElementsByTagName('i');\r
5908                     while (\r
5909                             div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i>< ![endif]-->',\r
5910                             all[0]\r
5911                             );\r
5912                     return v > 4 ? v : undef;\r
5913                 }());\r
5914                  if(scope.ie === 8){\r
5915                         ieFlag = true;\r
5916                     }\r
5917                     else{\r
5918                         ieFlag = false;\r
5919                     }\r
5920                 elem.bind('keydown',function(ev){\r
5921                     if (keymap.isAllowedKey(ev.keyCode) || keymap.isControl(ev) || keymap.isFunctionKey(ev)) {\r
5922                         ev.preventDefault();\r
5923                         ev.stopPropagation();\r
5924                         var el;\r
5925                     switch (ev.keyCode) {\r
5926                         case keymap.KEY.DOWN:\r
5927                             el = angular.element(elem[0])[0];\r
5928                             if(el && el.nextElementSibling){\r
5929                                 el.nextElementSibling.focus();\r
5930                             }\r
5931                             /*IE8 fix*/\r
5932                             if(ieFlag){\r
5933                                 do {\r
5934                                     if (el && el.nextSibling){\r
5935                                         el = el.nextSibling;\r
5936                                     }\r
5937                                     else{\r
5938                                         break;\r
5939                                     }\r
5940                                 } while (el && el.tagName !== 'DIV');\r
5941                                 el.focus();\r
5942                             }\r
5943                             break;\r
5944                         case keymap.KEY.UP:\r
5945                             el = angular.element(elem[0])[0];\r
5946                             if(el && el.previousElementSibling){\r
5947                                 el.previousElementSibling.focus();\r
5948                             }\r
5949                              /*IE8 fix*/\r
5950                              if(ieFlag){\r
5951                                 do {\r
5952                                     if (el && el.previousSibling){\r
5953                                         el = el.previousSibling;\r
5954                                     }\r
5955                                     else{\r
5956                                         break;\r
5957                                     }\r
5958                                 } while (el && el.tagName !== 'DIV');\r
5959                                 el.focus();\r
5960                             }\r
5961                             break;\r
5962                         case keymap.KEY.RIGHT:\r
5963                             if(angular.isDefined(sidepaneCtrl)){\r
5964                                 el = sidepaneCtrl.getElement()[0];\r
5965                             }\r
5966                             if(angular.isDefined(innerPaneCtrl)){\r
5967                                 el = innerPaneCtrl.getElement()[0];\r
5968                             }\r
5969                             do {\r
5970                                 if (el && el.nextElementSibling){\r
5971                                     el = el.nextElementSibling;\r
5972                                 }\r
5973                                 else{\r
5974                                     break;\r
5975                                 }\r
5976                             }while(window.getComputedStyle(el, null).getPropertyValue("display") === 'none');\r
5977                             /*IE8 fix*/\r
5978                             if(ieFlag){\r
5979                                 do {\r
5980                                     if (el && el.nextSibling){\r
5981                                         el = el.nextSibling;\r
5982                                     }\r
5983                                     else{\r
5984                                         break;\r
5985                                     }\r
5986                                 }while ((el && el.tagName == 'DIV') && el.currentStyle['display'] == 'none');\r
5987                             }\r
5988                            if (el){\r
5989                             el.querySelector("[att-pane-accessibility]").focus();\r
5990                         }\r
5991                         break;\r
5992                         case keymap.KEY.LEFT:\r
5993                             if(angular.isDefined(sidepaneCtrl)){\r
5994                                 el = sidepaneCtrl.getElement()[0];\r
5995                             }\r
5996                             if(angular.isDefined(innerPaneCtrl)){\r
5997                                 el = innerPaneCtrl.getElement()[0];\r
5998                             }\r
5999                             do {\r
6000                                 if (el && el.previousElementSibling){\r
6001                                     el = el.previousElementSibling;\r
6002                                 }\r
6003                                 else{\r
6004                                     break;\r
6005                                 }\r
6006                                 }while (window.getComputedStyle(el, null).getPropertyValue("display") == 'none');\r
6007                            \r
6008                             /*IE8 fix*/\r
6009                             if(ieFlag){\r
6010                                 do {\r
6011                                     if (el && el.previousSibling){\r
6012                                         el = el.previousSibling;\r
6013                                     }\r
6014                                     else{\r
6015                                         break;\r
6016                                     }\r
6017                                 }while((el && el.tagName == 'DIV') && el.currentStyle['display'] == 'none');   \r
6018                             }\r
6019                             if (el){\r
6020                             el.querySelector("[att-pane-accessibility]").focus();\r
6021                         }\r
6022                         break;\r
6023                         default:\r
6024                             break;\r
6025                         }\r
6026                     }\r
6027                 });\r
6028             }\r
6029         };\r
6030 }])\r
6031 .directive('sideRow', [function(){\r
6032     return {\r
6033         restrict: 'A',\r
6034         replace:true,\r
6035         require: ['^sidePane','^paneGroup'],\r
6036         link: function(scope,element,attr,ctrls){\r
6037             var sidePaneCtrl = ctrls[0];\r
6038             var paneGroupCtrl = ctrls[1];\r
6039             if(scope.$first){\r
6040                 /*\r
6041                 Reset the sidePaneId array if a new\r
6042                 set of ngRepeat data appeared\r
6043                 */\r
6044                 sidePaneCtrl.sidePaneIds = [];\r
6045             }\r
6046             var paneId =attr['paneId'];\r
6047             var drillDownTo = attr['drillDownTo'];\r
6048             sidePaneCtrl.sidePaneRows.push({'paneId':paneId, 'drillDownTo':drillDownTo});\r
6049             element.on('click', function(){\r
6050                 sidePaneCtrl.currentSelectedRowPaneId = paneId;\r
6051                 paneGroupCtrl.slideOutPane(paneId,true);\r
6052             });\r
6053         }\r
6054     };\r
6055 }])\r
6056 .controller('SidePaneCtrl',['$scope', '$element','animation', 'paneGroupConstants',\r
6057  function($scope,$element,animation, paneGroupConstants){\r
6058         this.getElement = function(){\r
6059             return $element;\r
6060         };\r
6061         this.sidePaneTracker = {};\r
6062         this.currentWidth = paneGroupConstants.SIDE_WIDTH_DEFAULT;\r
6063         this.paneId = paneGroupConstants.SIDE_PANE_ID;\r
6064         this.currentSelectedRowPaneId;\r
6065         this.drillDownToMapper = {};\r
6066         this.sidePaneRows = [];\r
6067         this.init = function(){\r
6068             var sidePaneRows = this.sidePaneRows;\r
6069             if(sidePaneRows){\r
6070                 for(var index in sidePaneRows){\r
6071                     if (sidePaneRows.hasOwnProperty(index)) {\r
6072                         var paneId = sidePaneRows[index].paneId;\r
6073                         var drillDownTo = sidePaneRows[index].drillDownTo;\r
6074                         this.drillDownToMapper[paneId] = drillDownTo;\r
6075                         if(index == 0){\r
6076                             this.currentSelectedRowPaneId = paneId;\r
6077                             this.sidePaneTracker[paneId] = [];\r
6078                         }\r
6079                     }\r
6080                 }\r
6081             }\r
6082         };\r
6083         this.getSidePanesList = function(){\r
6084             return this.sidePaneTracker[this.currentSelectedRowPaneId];\r
6085         };\r
6086         this.addToSidePanesList = function(newPaneId){\r
6087             if(this.sidePaneTracker[this.currentSelectedRowPaneId] === undefined){\r
6088                 this.sidePaneTracker[this.currentSelectedRowPaneId] = [];\r
6089             }\r
6090             else if(newPaneId){\r
6091                 this.sidePaneTracker[this.currentSelectedRowPaneId].push(newPaneId);\r
6092             }\r
6093         };\r
6094         this.setWidth = function(val){\r
6095             if(val){\r
6096                 this.currentWidth = val;\r
6097             }\r
6098             animation.set($element,{width:this.currentWidth});\r
6099         };\r
6100         this.resizeWidth = function(val){\r
6101             if(val){\r
6102                 this.currentWidth = val;\r
6103             }\r
6104             animation.to($element,.5,{width:val});\r
6105         };\r
6106 \r
6107 }])\r
6108 .directive('sidePane', ['paneGroupConstants', function(paneGroupConstants){\r
6109     return {\r
6110         restrict: 'EA',\r
6111         transclude: true,\r
6112         replace: true,\r
6113         templateUrl: 'app/scripts/ng_js_att_tpls/paneSelector/sidePane.html',\r
6114         require: ['^paneGroup', 'sidePane'],\r
6115         controller: 'SidePaneCtrl',\r
6116         scope:{},\r
6117         link: function(scope,element,attr, ctrls){\r
6118             var paneGroupCtrl = ctrls[0];\r
6119             var sidePaneCtrl = ctrls[1];\r
6120             paneGroupCtrl.addPaneCtrl(paneGroupConstants.SIDE_PANE_ID, sidePaneCtrl);\r
6121         }\r
6122     };\r
6123 }])\r
6124 .directive('drillDownRow', ['$parse', 'paneGroupConstants',function($parse,paneGroupConstants){\r
6125     return {\r
6126         restrict: 'A',\r
6127         replace:true,\r
6128         require: ['^innerPane','^paneGroup'],\r
6129         link: function(scope,element,attr,ctrls){\r
6130             var innerPaneCtrl = ctrls[0];\r
6131             var paneGroupCtrl = ctrls[1];\r
6132             element.on('click', function(){\r
6133                     var drillDownTo = innerPaneCtrl.drillDownTo;\r
6134                     if(innerPaneCtrl.drillDownTo !== paneGroupConstants.NO_DRILL_DOWN){\r
6135                         paneGroupCtrl.slideOutPane(drillDownTo);\r
6136                     }\r
6137                     element[0].focus();\r
6138             });\r
6139         }\r
6140     };\r
6141 }])\r
6142 .controller('InnerPaneCtrl', ['$scope', '$element','animation', 'paneGroupConstants',\r
6143         function($scope,$element,animation,paneGroupConstants){\r
6144         this.getElement = function(){\r
6145             return $element;\r
6146         };\r
6147         this.paneId = $scope.paneId;\r
6148         this.drillDownTo;\r
6149         this.currentWidth = paneGroupConstants.INNER_PANE_DEFAULT;\r
6150         this.setWidth = function(val){\r
6151             if(val){\r
6152                 this.currentWidth = val;\r
6153             }\r
6154             animation.set($element,{width:this.currentWidth});\r
6155         };\r
6156         this.resizeWidth = function(val,callback){\r
6157             animation.to($element,.25,{width:val,onComplete: callback});\r
6158         };\r
6159         this.displayNone = function(){\r
6160             animation.set($element, {display:'none'});\r
6161         };\r
6162         this.displayBlock = function(){\r
6163             animation.set($element,{display:'block'});\r
6164             if(this){\r
6165                 this.hideRightBorder();\r
6166             }\r
6167         };\r
6168         this.floatLeft = function(){\r
6169             animation.set($element,{float:'left'});\r
6170         };\r
6171         this.hideLeftBorder = function(){\r
6172             animation.set($element, {borderLeftWidth: '0px'});\r
6173         };\r
6174         this.showLeftBorder = function(){\r
6175             animation.set($element,{borderLeftWidth: '1px'});\r
6176         };\r
6177         this.hideRightBorder = function(){\r
6178             animation.set($element,{borderRightWidth: '0px'});\r
6179         };\r
6180         this.showRightBorder = function(){\r
6181             animation.set($element, {borderRightWidth: '1px'});\r
6182         };\r
6183         this.slideFromRight = function(){\r
6184             animation.set($element, {float:'right'});\r
6185             animation.set($element, {width: this.currentWidth});\r
6186         };\r
6187         this.startOpen = function(){\r
6188             return $scope.startOpen;\r
6189         };\r
6190 }])\r
6191 .directive('innerPane', function(){\r
6192     return {\r
6193         restrict: 'EA',\r
6194         replace: true,\r
6195         transclude: true,\r
6196         templateUrl: 'app/scripts/ng_js_att_tpls/paneSelector/innerPane.html',\r
6197         require: ['^paneGroup', 'innerPane'],\r
6198         controller: 'InnerPaneCtrl',\r
6199         scope:{\r
6200                 paneId:'@'\r
6201         },\r
6202         link: function(scope,element,attr,ctrls){\r
6203             if(attr.startOpen === ""){\r
6204                 scope.startOpen  = true;\r
6205             }\r
6206             var paneGroupCtrl = ctrls[0];\r
6207             var innerPaneCtrl = ctrls[1];\r
6208             paneGroupCtrl.addPaneCtrl(scope.paneId,innerPaneCtrl);\r
6209         }\r
6210     };\r
6211 })\r
6212 .controller('PaneGroupCtrl', ['$scope', '$element', 'paneGroupConstants',function($scope,$element,paneGroupConstants){\r
6213         this.panes = {};\r
6214         this.accountLevelPaneModel = [];\r
6215         this.title = $scope.title;\r
6216         this.init = function(){\r
6217                 var sidePane = this.panes[paneGroupConstants.SIDE_PANE_ID];\r
6218                 if(sidePane){\r
6219                     sidePane.init();\r
6220 \r
6221                     //Show the other panes that may be set to startOpen\r
6222                     //numOpen starts at 1 because of the side pane\r
6223                     var numOpen = 1;\r
6224                     var key;\r
6225                     for(key in this.panes){\r
6226                         if(this.panes[key].startOpen && this.panes[key].startOpen()){\r
6227                                 numOpen++;\r
6228                         }\r
6229                     }\r
6230                     var width;\r
6231                     if(numOpen >= 3){\r
6232                         width = ((100/numOpen)) + '%';\r
6233                     }\r
6234                     if(this.panes[sidePane.currentSelectedRowPaneId])\r
6235                     {\r
6236                         if(width){\r
6237                             sidePane.setWidth(width);\r
6238                             this.panes[sidePane.currentSelectedRowPaneId].setWidth(width);\r
6239                         }\r
6240                         else{\r
6241                             sidePane.setWidth();\r
6242                             this.panes[sidePane.currentSelectedRowPaneId].setWidth();\r
6243                         }\r
6244                         this.panes[sidePane.currentSelectedRowPaneId].displayBlock();\r
6245                         for(key in this.panes){\r
6246                             if(key !== paneGroupConstants.SIDE_PANE_ID && key !== sidePane.currentSelectedRowPaneId){\r
6247                                 this.panes[key].displayNone();\r
6248                             }\r
6249                                 this.panes[key].drillDownTo = sidePane.drillDownToMapper[key];\r
6250                         }\r
6251                     }\r
6252                     openOtherPanesOnStart(sidePane, this.panes);\r
6253                 }\r
6254 \r
6255                 function openOtherPanesOnStart(sidePane, panes){\r
6256                     //Build an array of the panes that need to be out\r
6257                     var otherPanesStartOpened = [];\r
6258                     var index;\r
6259                     for(index in sidePane.sidePaneRows){\r
6260                         if (sidePane.sidePaneRows.hasOwnProperty(index)) {\r
6261                             var pane = sidePane.sidePaneRows[index];\r
6262 \r
6263                             //Skip the first pane row since we handled it in the begining\r
6264                             if(index > 0 && panes[pane.paneId].startOpen && panes[pane.paneId].startOpen()){\r
6265                                     otherPanesStartOpened.push(pane);\r
6266                                     //Remember the panes that are opened for the first pane row Index\r
6267                                     sidePane.addToSidePanesList(pane.paneId);\r
6268                             }\r
6269                         }\r
6270                     }\r
6271 \r
6272                     if(width){\r
6273                         for(index in otherPanesStartOpened){\r
6274                             if (otherPanesStartOpened.hasOwnProperty(index)) {\r
6275                                 var paneId = otherPanesStartOpened[index].paneId;\r
6276                                 var paneCtrl = panes[paneId];\r
6277                                 if(paneCtrl && paneCtrl.setWidth && paneCtrl.displayBlock){\r
6278                                     paneCtrl.setWidth(width);\r
6279                                     paneCtrl.displayBlock();\r
6280                                 }\r
6281                             }\r
6282                         }\r
6283                     }\r
6284 \r
6285                 }\r
6286         };\r
6287 \r
6288         /*\r
6289           Resets all the panels to their original positions at the end of a sidebar click\r
6290           By setting the sideBar to its default width\r
6291           Setting all panes to float left and displaynone\r
6292           Setting the pane that was clicked to default width and slide right\r
6293         */\r
6294 \r
6295         this.resetPanes = function(){\r
6296             for(var key in this.panes){\r
6297                 if(this.panes.hasOwnProperty(key)){\r
6298                     var pane = this.panes[key];\r
6299                     if(pane && (pane.paneId !== paneGroupConstants.SIDE_PANE_ID)){\r
6300                             pane.floatLeft();\r
6301                             pane.displayNone();\r
6302                     }\r
6303                 }\r
6304             }\r
6305 \r
6306             if(this.panes[paneGroupConstants.SIDE_PANE_ID]){\r
6307                 this.panes[paneGroupConstants.SIDE_PANE_ID].setWidth(paneGroupConstants.SIDE_WIDTH_DEFAULT);\r
6308             }\r
6309         };\r
6310 \r
6311         this.addPaneCtrl = function(paneId,paneCtrl){\r
6312             this.panes[paneId] = paneCtrl;\r
6313         };\r
6314 \r
6315         this._slideOutPane = function(paneId,isFromSidePane){\r
6316                 this.resetPanes();\r
6317                 //Check current side pane stack to see how many panes are already open for that side pane choice\r
6318                 //then add the new pane that needs to be there\r
6319                 var panesList;\r
6320                 if(isFromSidePane){\r
6321 \r
6322                     //Check if the side pane id has already been clicked\r
6323                     if(this.panes[paneGroupConstants.SIDE_PANE_ID]){\r
6324                         panesList = this.panes[paneGroupConstants.SIDE_PANE_ID].getSidePanesList();\r
6325                     }\r
6326                     if(!panesList){\r
6327                         if(this.panes && this.panes[paneGroupConstants.SIDE_PANE_ID] && this.panes[paneId]){\r
6328                             this.panes[paneGroupConstants.SIDE_PANE_ID].currentSelectedRowPaneId = paneId;\r
6329                             this.panes[paneGroupConstants.SIDE_PANE_ID].addToSidePanesList();\r
6330 \r
6331                             this.panes[paneId].slideFromRight();\r
6332                             this.panes[paneId].displayBlock();\r
6333 \r
6334                             this.panes[paneId].setWidth(paneGroupConstants.INNER_PANE_DEFAULT);\r
6335                         }\r
6336                     }\r
6337                     else if(this.panes && this.panes[paneGroupConstants.SIDE_PANE_ID]){\r
6338                                 //Restore the panes based on the panelist\r
6339                         if(panesList.length === 0 && this.panes[paneId]){\r
6340                             //Only one pane is out\r
6341                             this.panes[paneGroupConstants.SIDE_PANE_ID].setWidth(paneGroupConstants.SIDE_WIDTH_DEFAULT);\r
6342                             this.panes[paneId].displayBlock();\r
6343                             this.panes[paneId].setWidth(paneGroupConstants.INNER_PANE_DEFAULT);\r
6344                         }\r
6345                         else{\r
6346                             //Multiple panes out\r
6347                             var numPanes = panesList.length + 2;\r
6348                             var width = ((100/numPanes)) + '%';\r
6349                             this.panes[paneGroupConstants.SIDE_PANE_ID].setWidth(width);\r
6350 \r
6351                             //Set the sidePanes pane\r
6352                             //set the panes children list\r
6353                             if(this.panes[this.panes[paneGroupConstants.SIDE_PANE_ID].currentSelectedRowPaneId]){\r
6354                                 this.panes[this.panes[paneGroupConstants.SIDE_PANE_ID].currentSelectedRowPaneId].displayBlock();\r
6355                                 this.panes[this.panes[paneGroupConstants.SIDE_PANE_ID].currentSelectedRowPaneId].setWidth(width);\r
6356                             }\r
6357                             for(var i in panesList){\r
6358                                 if(this.panes[panesList[i]]){\r
6359                                         this.panes[panesList[i]].displayBlock();\r
6360                                         this.panes[panesList[i]].setWidth(width);\r
6361                                 }\r
6362                             }\r
6363                         }\r
6364                     }\r
6365                 }\r
6366                 else{\r
6367 \r
6368                     //Have to check the paneId that was given and where it is drilling down to\r
6369                     var isPaneInStack = false;\r
6370                     var stackPaneList;\r
6371                     if(this.panes[paneGroupConstants.SIDE_PANE_ID]){\r
6372                         stackPaneList = this.panes[paneGroupConstants.SIDE_PANE_ID].getSidePanesList();\r
6373                     }\r
6374                     for(var j in stackPaneList){\r
6375                         if(stackPaneList.hasOwnProperty(j)){\r
6376                             var pId = stackPaneList[j];\r
6377                             if(pId === paneId){\r
6378                                 isPaneInStack = true;\r
6379                                 break;\r
6380                             }\r
6381                         }\r
6382                     }\r
6383                     if(!isPaneInStack && this.panes[paneGroupConstants.SIDE_PANE_ID]){\r
6384                         this.panes[paneGroupConstants.SIDE_PANE_ID].addToSidePanesList(paneId);\r
6385                     }\r
6386                     var sidePanesListLength;\r
6387                     if(this.panes[paneGroupConstants.SIDE_PANE_ID]){\r
6388                         sidePanesListLength = this.panes[paneGroupConstants.SIDE_PANE_ID].getSidePanesList().length;\r
6389                     }\r
6390                     var numberPanes = sidePanesListLength + 2;\r
6391                     var widthToSet = ((100/numberPanes)) + '%';\r
6392                     if(this.panes[paneGroupConstants.SIDE_PANE_ID]){\r
6393                         this.panes[paneGroupConstants.SIDE_PANE_ID].setWidth(widthToSet);\r
6394                     }\r
6395                     var slideInPaneId;\r
6396 \r
6397                     if(this.panes[paneGroupConstants.SIDE_PANE_ID]){\r
6398                             slideInPaneId = this.panes[paneGroupConstants.SIDE_PANE_ID].getSidePanesList()[sidePanesListLength - 1];\r
6399                     }\r
6400 \r
6401                     var that = this;\r
6402 \r
6403                     if(that.panes[paneGroupConstants.SIDE_PANE_ID]){\r
6404                             panesList = that.panes[paneGroupConstants.SIDE_PANE_ID].getSidePanesList();\r
6405                     }\r
6406 \r
6407                     for(var p in panesList){\r
6408                         if(panesList.hasOwnProperty(p)){\r
6409                             var paneListPaneId = panesList[p];\r
6410                             var pane = this.panes[paneListPaneId];\r
6411                             if(paneListPaneId !== slideInPaneId && pane){\r
6412                                     pane.setWidth(widthToSet);\r
6413                                     pane.displayBlock();\r
6414                                     pane.floatLeft();\r
6415                             }\r
6416                         }\r
6417                     }\r
6418 \r
6419                     if(this.panes[this.panes[paneGroupConstants.SIDE_PANE_ID].currentSelectedRowPaneId]){\r
6420                             this.panes[this.panes[paneGroupConstants.SIDE_PANE_ID].currentSelectedRowPaneId].displayBlock();\r
6421                             this.panes[this.panes[paneGroupConstants.SIDE_PANE_ID].currentSelectedRowPaneId].showRightBorder();\r
6422 \r
6423                             this.panes[this.panes[paneGroupConstants.SIDE_PANE_ID].currentSelectedRowPaneId].resizeWidth(widthToSet,function(){\r
6424 \r
6425                                     if(that.panes[slideInPaneId] && that.panes[that.panes[paneGroupConstants.SIDE_PANE_ID].currentSelectedRowPaneId]){\r
6426                                             that.panes[that.panes[paneGroupConstants.SIDE_PANE_ID].currentSelectedRowPaneId].hideRightBorder();\r
6427                                             that.panes[slideInPaneId].setWidth(widthToSet);\r
6428                                             that.panes[slideInPaneId].slideFromRight();\r
6429                                             that.panes[slideInPaneId].displayBlock();\r
6430                                             that.panes[slideInPaneId].floatLeft();\r
6431                                     }\r
6432 \r
6433                             });\r
6434                     }\r
6435                 }\r
6436         };\r
6437 \r
6438         this.slideOutPane = function(paneId,isFromSidePane){\r
6439             this._slideOutPane(paneId,isFromSidePane);\r
6440         };\r
6441 }])\r
6442 .directive('paneGroup', ['$timeout',function($timeout){\r
6443         return {\r
6444                 restrict: 'EA',\r
6445                 transclude: true,\r
6446                 replace: true,\r
6447                 templateUrl: 'app/scripts/ng_js_att_tpls/paneSelector/paneGroup.html',\r
6448                 scope:{\r
6449                 },\r
6450                 controller: 'PaneGroupCtrl',\r
6451                 link: function(scope,element,attr,ctrl){\r
6452                         $timeout(initialize,100);\r
6453                         function initialize(){\r
6454                                 ctrl.init();\r
6455                         }\r
6456                 }\r
6457         };\r
6458 }]);\r
6459 angular.module('att.abs.tooltip', ['att.abs.position', 'att.abs.utilities', 'ngSanitize'])\r
6460         // The default options tooltip and popover.\r
6461         .constant('tooltipDefaultOptions', {\r
6462             placement: 'above',\r
6463             animation: false,\r
6464             popupDelay: 0,\r
6465             stylett: 'dark',\r
6466             appendToBody: true\r
6467         })\r
6468 \r
6469         /**\r
6470          * The $tooltip service creates tooltip- and popover-like directives as well as\r
6471          * houses global options for them.\r
6472          */\r
6473         .provider('$tooltip', ['tooltipDefaultOptions', function(tooltipDefaultOptions) {\r
6474 \r
6475             // Default hide triggers for each show trigger\r
6476             var triggerMap = {\r
6477                 'mouseenter': 'mouseleave',\r
6478                 'click': 'click',\r
6479                 'focus': 'blur',\r
6480                 'mouseover':'mouseout'\r
6481             };\r
6482 \r
6483             // The options specified to the provider globally.\r
6484             var globalOptions = {};\r
6485 \r
6486             this.options = function(value) {\r
6487                 angular.extend(globalOptions, value);\r
6488             };\r
6489 \r
6490             /**\r
6491              * This allows you to extend the set of trigger mappings available. E.g.:\r
6492              *\r
6493              *   $tooltipProvider.setTriggers( 'openTrigger': 'closeTrigger' );\r
6494              */\r
6495             this.setTriggers = function(triggers) {\r
6496                 angular.extend(triggerMap, triggers);\r
6497             };\r
6498 \r
6499             /**\r
6500              * This is a helper function for translating camel-case to snake-case.\r
6501              */\r
6502             function snakeCase(name) {\r
6503                 var regexp = /[A-Z]/g;\r
6504                 var separator = '-';\r
6505                 return name.replace(regexp, function(letter, pos) {\r
6506                     return (pos ? separator : '') + letter.toLowerCase();\r
6507                 });\r
6508             }\r
6509 \r
6510             /**\r
6511              * Returns the actual instance of the $tooltip service.\r
6512              */\r
6513             this.$get = ['$window', '$compile', '$timeout', '$parse', '$document', '$position', '$interpolate', '$attElementDetach', function($window, $compile, $timeout, $parse, $document, $position, $interpolate, $attElementDetach) {\r
6514                     return function (type, prefix, defaultTriggerShow) {\r
6515                         var options = angular.extend({}, tooltipDefaultOptions, globalOptions);\r
6516                         /**\r
6517                          * Returns an object of show and hide triggers.\r
6518                          *\r
6519                          * If a trigger is supplied,\r
6520                          * it is used to show the tooltip; otherwise, it will use the `trigger`\r
6521                          * option passed to the `$tooltipProvider.options` method; else it will\r
6522                          * default to the trigger supplied to this directive factory.\r
6523                          *\r
6524                          * The hide trigger is based on the show trigger. If the `trigger` option\r
6525                          * was passed to the `$tooltipProvider.options` method, it will use the\r
6526                          * mapped trigger from `triggerMap` or the passed trigger if the map is\r
6527                          * undefined; otherwise, it uses the `triggerMap` value of the show\r
6528                          * trigger; else it will just use the show trigger.\r
6529                          */\r
6530                         function getTriggers(trigger) {\r
6531                             var show = trigger || options.trigger || defaultTriggerShow;\r
6532                             var hide = triggerMap[show] || show;\r
6533                             return {\r
6534                                 show: show,\r
6535                                 hide: hide\r
6536                             };\r
6537                         }\r
6538 \r
6539                         var directiveName = snakeCase(type);\r
6540 \r
6541                         var startSym = $interpolate.startSymbol();\r
6542                         var endSym = $interpolate.endSymbol();\r
6543 \r
6544                         return {\r
6545                             restrict: 'EA',\r
6546                             scope: true,\r
6547                             link: function (scope, element, attrs) {\r
6548                                 /* Allows a developer to force element to be non-tabable */\r
6549                                 if (!element.attr('tabindex')) {\r
6550                                     element.attr('tabindex', '0');\r
6551                                 } \r
6552 \r
6553                                 var isElementHovered = false;\r
6554                                 element.bind('mouseenter', function(){\r
6555                                     isElementHovered = true;\r
6556                                     element.removeAttr('title');\r
6557                                 });\r
6558                                 element.bind('mouseleave', function(){\r
6559                                     isElementHovered = false;\r
6560                                  //   setTooltipAriaLabel();\r
6561                                 });\r
6562 \r
6563                                 /* We store our attributes on our scope so any user of $tooltip service can access attributes */\r
6564                                 scope.parentAttrs = attrs;\r
6565                                 var template =\r
6566                                         '<div ' + directiveName + '-popup ' +\r
6567                                         'title="' + startSym + 'tt_title' + endSym + '" ' +\r
6568                                         'content="' + startSym + 'tt_content' + endSym + '" ' +\r
6569                                         'placement="' + startSym + 'tt_placement' + endSym + '" ' +\r
6570                                         'animation="tt_animation()" ' +\r
6571                                         'is-open="tt_isOpen" ' +\r
6572                                         'stylett="' + startSym + 'tt_style' + endSym + '" ' +\r
6573                                         '>' +\r
6574                                         '</div>';\r
6575 \r
6576                                 var tooltip = $compile(template)(scope);\r
6577                                 var transitionTimeout;\r
6578                                 var popupTimeout;\r
6579                                 var $body;\r
6580                                 var appendToBody = angular.isDefined(options.appendToBody) ? options.appendToBody : false;\r
6581                                 var triggers = getTriggers(undefined);\r
6582                                 var hasRegisteredTriggers = false;\r
6583                                 var hasEnableExp = angular.isDefined(attrs[prefix + 'Enable']);\r
6584                                 var tooltipOffset = 0;\r
6585                                 var tooltipAriaLabelDefined = false;\r
6586 \r
6587                                 // By default, the tooltip is not open.\r
6588                                 // add ability to start tooltip opened\r
6589                                 scope.tt_isOpen = false;\r
6590 \r
6591                                 //Adding a scope watch, to remove the created popup from DOM, incase it is updated outside the provider code.\r
6592                                 scope.$watch('tt_isOpen', function(newVal, oldVal){\r
6593                                     if(newVal !== oldVal && !newVal){\r
6594                                         $attElementDetach(tooltip[0]);\r
6595                                     }\r
6596                                 });\r
6597 \r
6598                                 function toggleTooltipBind() {\r
6599                                     if (!scope.tt_isOpen) {\r
6600                                         showTooltipBind();\r
6601                                     } else {\r
6602                                         hideTooltipBind();\r
6603                                     }\r
6604                                 }\r
6605 \r
6606                                 // Show the tooltip with delay if specified, otherwise show it immediately\r
6607                                 function showTooltipBind() {\r
6608                                     if (hasEnableExp && !scope.$eval(attrs[prefix + 'Enable'])) {\r
6609                                         return;\r
6610                                     }\r
6611                                     if (scope.tt_popupDelay) {\r
6612                                         popupTimeout = $timeout(show, scope.tt_popupDelay);\r
6613                                     } else {\r
6614                                         scope.$apply(show);\r
6615                                     }\r
6616                                 }\r
6617 \r
6618                                 function hideTooltipBind() {\r
6619                                     scope.$apply(function() {\r
6620                                         hide();\r
6621                                     });\r
6622                                 }\r
6623 \r
6624                                 // Show the tooltip popup element.\r
6625                                 function show() {\r
6626                                     var position,\r
6627                                             ttWidth,\r
6628                                             ttHeight,\r
6629                                             ttPosition;\r
6630 \r
6631                                     // Don't show empty tooltips.\r
6632                                     if (!scope.tt_content) {\r
6633                                         return;\r
6634                                     }\r
6635 \r
6636                                     // If there is a pending remove transition, we must cancel it, lest the\r
6637                                     // tooltip be mysteriously removed.\r
6638                                     if (transitionTimeout) {\r
6639                                         $timeout.cancel(transitionTimeout);\r
6640                                     }\r
6641 \r
6642                                     // Set the initial positioning.\r
6643                                     tooltip.css({top: 0, left: 0, display: 'block', 'z-index': 9999});\r
6644 \r
6645                                     // Now we add it to the DOM because need some info about it. But it's not\r
6646                                     // visible yet anyway.\r
6647                                     if (appendToBody) {\r
6648                                         $body = $body || $document.find('body');\r
6649                                         $body.append(tooltip);\r
6650                                     } else {\r
6651                                         element.after(tooltip);\r
6652                                     }\r
6653 \r
6654                                     // Get the position of the directive element.\r
6655                                     position = appendToBody ? $position.offset(element) : $position.position(element);\r
6656 \r
6657                                     // Get the height and width of the tooltip so we can center it.\r
6658                                     ttWidth = tooltip.prop('offsetWidth');\r
6659                                     ttHeight = tooltip.prop('offsetHeight');\r
6660 \r
6661                                     // Calculate the tooltip's top and left coordinates to center it with\r
6662                                     // this directive.\r
6663                                     var ttArrowOffset = 10;\r
6664                                     switch (scope.tt_placement) {\r
6665                                         case 'right':\r
6666                                             if(appendToBody){\r
6667                                                 ttPosition = {\r
6668                                                     top: position.top + position.height / 2 - ttHeight / 2,\r
6669                                                     left: (position.left + position.width) + tooltipOffset\r
6670                                                 };\r
6671                                             }else{\r
6672                                                 ttPosition = {\r
6673                                                     top: position.top + position.height / 2 - ttHeight / 2,\r
6674                                                     left: (position.left + position.width + ttArrowOffset) + tooltipOffset\r
6675                                                 };\r
6676                                             }\r
6677                                             break;\r
6678                                         case 'below':\r
6679                                             if(appendToBody){\r
6680                                                 ttPosition = {\r
6681                                                     top: (position.top + position.height) + tooltipOffset,\r
6682                                                     left: position.left + position.width / 2 - ttWidth / 2\r
6683                                                 };\r
6684                                             }else{\r
6685                                                 ttPosition = {\r
6686                                                     top: (position.top + position.height + ttArrowOffset) + tooltipOffset,\r
6687                                                     left: position.left + position.width / 2 - ttWidth / 2\r
6688                                                 };\r
6689                                             }\r
6690                                             break;\r
6691                                         case 'left':\r
6692                                             if(appendToBody){\r
6693                                                 ttPosition = {\r
6694                                                     top: position.top + position.height / 2 - ttHeight / 2,\r
6695                                                     left: (position.left - ttWidth) - tooltipOffset\r
6696                                                 };\r
6697                                             }else{\r
6698                                                 ttPosition = {\r
6699                                                     top: position.top + position.height / 2 - ttHeight / 2,\r
6700                                                     left: (position.left - ttWidth - ttArrowOffset) - tooltipOffset\r
6701                                                 };\r
6702                                             }\r
6703                                             break;\r
6704                                         default:\r
6705                                             if(appendToBody){\r
6706                                                 ttPosition = {\r
6707                                                     top: (position.top - ttHeight) - tooltipOffset,\r
6708                                                     left: position.left + position.width / 2 - ttWidth / 2\r
6709                                                 };\r
6710                                             }else{\r
6711                                                 ttPosition = {\r
6712                                                     top: (position.top - ttHeight - ttArrowOffset) - tooltipOffset,\r
6713                                                     left: position.left + position.width / 2 - ttWidth / 2\r
6714                                                 };\r
6715                                             }\r
6716                                             break;\r
6717                                     }\r
6718 \r
6719                                     ttPosition.top += 'px';\r
6720                                     ttPosition.left += 'px';\r
6721 \r
6722                                     // Now set the calculated positioning.\r
6723                                     tooltip.css(ttPosition);\r
6724 \r
6725                                     // And show the tooltip.\r
6726                                     scope.tt_isOpen = true;\r
6727                                 }\r
6728 \r
6729                                 // Hide the tooltip popup element.\r
6730                                 function hide() {\r
6731                                     // First things first: we don't show it anymore.\r
6732                                     scope.tt_isOpen = false;\r
6733 \r
6734                                     //if tooltip is going to be shown after delay, we must cancel this\r
6735                                     $timeout.cancel(popupTimeout);\r
6736 \r
6737                                     // And now we remove it from the DOM. However, if we have animation, we\r
6738                                     // need to wait for it to expire beforehand.\r
6739                                     // This is a placeholder for a port of the transitions library.\r
6740                                     if (angular.isDefined(scope.tt_animation) && scope.tt_animation()) {\r
6741                                         transitionTimeout = $timeout(function() {\r
6742                                             $attElementDetach(tooltip[0]);\r
6743                                         }, 500);\r
6744                                     } else {\r
6745                                         $attElementDetach(tooltip[0]);\r
6746                                     }\r
6747                                 }\r
6748 \r
6749                                 function setTooltipAriaLabel() {\r
6750                                     element.removeAttr('title');\r
6751                                     if(!isElementHovered){\r
6752                                         if (tooltipAriaLabelDefined) {\r
6753                                             element.attr('title', scope.tooltipAriaLabel);\r
6754                                         } else {\r
6755                                             element.attr('title', scope.tt_content);\r
6756                                         }\r
6757                                     }\r
6758                                 }\r
6759 \r
6760                                 /**\r
6761                                  * Observe the relevant attributes.\r
6762                                  */\r
6763                                 attrs.$observe(type, function(val) {\r
6764                                     if (val) {\r
6765                                         scope.tt_content = val;\r
6766                                        // setTooltipAriaLabel();\r
6767                                     } else {\r
6768                                         if (scope.tt_isOpen) {\r
6769                                             hide();\r
6770                                         }\r
6771                                     }\r
6772                                 });\r
6773 \r
6774                                 attrs.$observe(prefix + 'Title', function(val) {\r
6775                                     scope.tt_title = val;\r
6776                                 });\r
6777 \r
6778                                 attrs.$observe(prefix + 'Placement', function(val) {\r
6779                                     scope.tt_placement = angular.isDefined(val) ? val : options.placement;\r
6780                                 });\r
6781 \r
6782                                 attrs.$observe(prefix + 'Style', function(val) {\r
6783                                     scope.tt_style = angular.isDefined(val) ? val : options.stylett;\r
6784                                 });\r
6785 \r
6786                                 attrs.$observe(prefix + 'Animation', function(val) {\r
6787                                     scope.tt_animation = angular.isDefined(val) ? $parse(val) : function() {\r
6788                                         return options.animation;\r
6789                                     };\r
6790                                 });\r
6791 \r
6792                                 attrs.$observe(prefix + 'PopupDelay', function(val) {\r
6793                                     var delay = parseInt(val, 10);\r
6794                                     scope.tt_popupDelay = !isNaN(delay) ? delay : options.popupDelay;\r
6795                                 });\r
6796 \r
6797                                 attrs.$observe(prefix + 'Trigger', function(val) {\r
6798 \r
6799                                     if (hasRegisteredTriggers) {\r
6800                                         element.unbind(triggers.show, showTooltipBind);\r
6801                                         element.unbind(triggers.hide, hideTooltipBind);\r
6802                                     }\r
6803 \r
6804                                     triggers = getTriggers(val);\r
6805 \r
6806                                     /* This fixes issue in which a click on input field with trigger as focus \r
6807                                         causes focus to fire following click thus making tooltip flash. */\r
6808                                     if (triggers.show === 'focus') {\r
6809                                         element.bind('focus', showTooltipBind);\r
6810                                         element.bind('blur', hideTooltipBind);\r
6811                                         element.bind('click', function(e) {\r
6812                                             e.stopPropagation();\r
6813                                         });\r
6814                                     } else if (triggers.show === triggers.hide) {\r
6815                                         element.bind(triggers.show, toggleTooltipBind);\r
6816                                     } else {\r
6817                                         element.bind(triggers.show, showTooltipBind);\r
6818                                         element.bind(triggers.hide, hideTooltipBind);\r
6819                                     }\r
6820 \r
6821                                     hasRegisteredTriggers = true;\r
6822                                 });\r
6823 \r
6824                                 attrs.$observe(prefix + 'AppendToBody', function (val) {\r
6825                                     appendToBody = angular.isDefined(val) ? $parse(val)(scope) : appendToBody;\r
6826                                 });\r
6827 \r
6828                                 attrs.$observe(prefix + 'Offset', function (val) {\r
6829                                     tooltipOffset = angular.isDefined(val) ? parseInt(val, 10) : 0;\r
6830                                 });\r
6831 \r
6832                                 attrs.$observe(prefix + 'AriaLabel', function (val) {\r
6833                                     if (angular.isDefined(val)) {\r
6834                                         scope.tooltipAriaLabel = val;\r
6835                                         tooltipAriaLabelDefined = true;\r
6836                                     } else {\r
6837                                         tooltipAriaLabelDefined = false;\r
6838                                     }\r
6839                                     setTooltipAriaLabel();\r
6840                                 });\r
6841 \r
6842                                 // if a tooltip is attached to <body> we need to remove it on\r
6843                                 // location change as its parent scope will probably not be destroyed\r
6844                                 // by the change.\r
6845                                 if (appendToBody) {\r
6846                                     scope.$on('$locationChangeSuccess', function() {\r
6847                                         if (scope.tt_isOpen) {\r
6848                                             hide();\r
6849                                         }\r
6850                                     });\r
6851                                 }\r
6852 \r
6853                                 // Make sure tooltip is destroyed and removed.\r
6854                                 scope.$on('$destroy', function() {\r
6855                                     if (scope.tt_isOpen) {\r
6856                                         hide();\r
6857                                     } else {\r
6858                                         tooltip.remove();\r
6859                                     }\r
6860                                 });\r
6861                             }\r
6862                         };\r
6863                     };\r
6864                 }];\r
6865         }])\r
6866 \r
6867         .directive('tooltipPopup', ['$document', '$documentBind', function($document, $documentBind) {\r
6868             return {\r
6869                 restrict: 'EA',\r
6870                 replace: true,\r
6871                 transclude: true,\r
6872                 scope: {content: '@', placement: '@', animation: '&', isOpen: '=', stylett: '@'},\r
6873                 templateUrl: 'app/scripts/ng_js_att_tpls/tooltip/tooltip-popup.html',\r
6874                 link: function(scope, elem) {\r
6875                     scope.$watch("isOpen", function() {\r
6876                         scope.isOpen;\r
6877                     });\r
6878                     elem.bind('click', function (e) {\r
6879                         e.stopPropagation();\r
6880                     });\r
6881                     var outsideClick = function() {\r
6882                         scope.$apply(function() {\r
6883                             scope.isOpen = false;\r
6884                         });\r
6885                     };\r
6886 \r
6887                     $documentBind.event('click', 'isOpen', outsideClick, scope, true, 10);\r
6888                 }\r
6889             };\r
6890         }])\r
6891 \r
6892         .directive('tooltip', ['$tooltip', function($tooltip) {\r
6893             return $tooltip('tooltip', 'tooltip', 'mouseenter');\r
6894         }])\r
6895 \r
6896         .directive('tooltipCondition', [ '$timeout',function($timeout) {\r
6897                 return  {\r
6898                     restrict: 'EA',\r
6899                     replace: true,\r
6900                     scope:{\r
6901                         tooltipCondition:"@?"\r
6902                     },\r
6903                     template:'<p><span tooltip=\"{{tooltipCondition}}\" ng-if=\"showpop\">{{tooltipCondition}}</span><span id=\"innerElement\" ng-hide=\"showpop\">{{tooltipCondition}}</span></p>',\r
6904                     link: function(scope, elem, attr){\r
6905                         scope.showpop=false;\r
6906                         if(attr.height==='true'){\r
6907                             $timeout(function () {\r
6908                                var maxHeight=(elem[0].offsetHeight);\r
6909                                var elemHeight=elem.children(0)[0].offsetHeight;\r
6910                                if(elemHeight > maxHeight){\r
6911                                    scope.showpop=true;\r
6912                                }\r
6913                             });\r
6914                         }\r
6915                         else if(scope.tooltipCondition.length>=25){\r
6916                         scope.showpop=true;\r
6917                         }\r
6918                     }\r
6919                 };\r
6920         }]);\r
6921 angular.module('att.abs.popOvers', ['att.abs.tooltip', 'att.abs.utilities', 'ngSanitize'])\r
6922         .directive('popover', ['$tooltip', function($tooltip) {\r
6923                 return $tooltip('popover', 'popover', 'click');\r
6924             }])\r
6925         .directive('popoverPopup', ['$document', '$documentBind', '$timeout', 'events', 'DOMHelper', function($document, $documentBind, $timeout, events, DOMHelper) {\r
6926                 return {\r
6927                     restrict: 'EA',\r
6928                     replace: true,\r
6929                     transclude: true,\r
6930                     templateUrl: 'app/scripts/ng_js_att_tpls/popOvers/popOvers.html',\r
6931                     scope: {content: '@', placement: '@', animation: '&', isOpen: '=', stylett: '@'},\r
6932                     link: function(scope, elem, attr, ctrl) {\r
6933 \r
6934                         scope.closeable = false;\r
6935                         try {\r
6936                             scope.closeable = scope.$parent.parentAttrs['closeable'] === '' ? true : false;\r
6937                         } catch (e) {}\r
6938 \r
6939                         /* Before opening modal, find the focused element */\r
6940                         var launchingElement = undefined, \r
6941                             firstTabableElement = undefined;\r
6942 \r
6943                         var outsideClick = function(evt) {\r
6944                             scope.$apply(function() {\r
6945                                 scope.isOpen = false;\r
6946                             });\r
6947                         };\r
6948                         var escKeydown = function(evt) {\r
6949                             if (evt.which === 27 || evt.keyCode === 27) {\r
6950                                     console.log('ESC was pressed!');\r
6951                                     scope.$apply(function() {\r
6952                                         scope.isOpen = false;\r
6953                                 });\r
6954                             }\r
6955                         };\r
6956 \r
6957                         $timeout(function() {\r
6958                             firstTabableElement = DOMHelper.firstTabableElement(elem);\r
6959                         }, 10, false);\r
6960                         \r
6961                         scope.$watch('isOpen', function(value) {\r
6962                             if (scope.isOpen) {\r
6963                                 launchingElement = document.activeElement;\r
6964                                 /* Focus on first tabbable element */\r
6965                                 if (angular.isDefined(firstTabableElement)) {\r
6966                                     try {\r
6967                                         firstTabableElement.focus();\r
6968                                     } catch(e) {}\r
6969                                 }\r
6970                             } else {\r
6971                                 if (angular.isDefined(launchingElement)) {\r
6972                                     try {\r
6973                                         launchingElement.focus();\r
6974                                     } catch (e) {} /* IE8 will throw exception */\r
6975                                 }\r
6976                             }\r
6977                         });\r
6978                         \r
6979                         scope.$watch("stylett", function(value) {\r
6980                             scope.popOverStyle = value;\r
6981                         });\r
6982 \r
6983                         scope.$watch("placement", function(value) {\r
6984                             scope.popOverPlacement = value;\r
6985                         });\r
6986                         \r
6987                         scope.closeMe = function(){\r
6988                            scope.isOpen = false;\r
6989                         };\r
6990                         \r
6991                         elem.bind('click', function (e) {\r
6992                             events.stopPropagation(e);\r
6993                         });\r
6994                         \r
6995                         $documentBind.event('click', 'isOpen', outsideClick, scope, true, 10);\r
6996                         $documentBind.event('keydown', 'isOpen', escKeydown, scope, true, 10);\r
6997                     }\r
6998                 };\r
6999             }]);\r
7000 \r
7001 angular.module('att.abs.profileCard', [])\r
7002             .constant('profileStatus',{\r
7003                 status:{\r
7004                     ACTIVE:{status:"Active",color:"green"},\r
7005                     DEACTIVATED:{status:"Deactivated",color:"red"},\r
7006                     LOCKED:{status:"Locked",color:"red"},\r
7007                     IDLE:{status:"Idle",color:"yellow"},\r
7008                     PENDING:{status:"Pending",color:"blue"}\r
7009                     },\r
7010                 role:"COMPANY ADMINISTRATOR"\r
7011                 })\r
7012             .directive('profileCard',['$http','$q','profileStatus', function($http,$q,profileStatus) {\r
7013                return {\r
7014                     restrict: 'EA',\r
7015                     replace:'true',\r
7016                     templateUrl:function(element, attrs){\r
7017                         if(!attrs.addUser){\r
7018                             return 'app/scripts/ng_js_att_tpls/profileCard/profileCard.html';\r
7019                         }\r
7020                         else{\r
7021                             return 'app/scripts/ng_js_att_tpls/profileCard/addUser.html';\r
7022                         }\r
7023                     },\r
7024                     scope:{\r
7025                         profile:'='\r
7026                     },\r
7027                     link: function(scope, elem, attr){\r
7028                         scope.image=true;\r
7029                         function isImage(src) {\r
7030                             var deferred = $q.defer();\r
7031                             var image = new Image();\r
7032                             image.onerror = function() {\r
7033                                 deferred.reject(false);\r
7034                             };\r
7035                             image.onload = function() {\r
7036                                 deferred.resolve(true);\r
7037                             };\r
7038                             if(src!==undefined && src.length>0 ){\r
7039                                 image.src = src;\r
7040                             }else{\r
7041                                  deferred.reject(false);\r
7042                             }\r
7043                             return deferred.promise;\r
7044                         }\r
7045                         if(!attr.addUser){\r
7046                         scope.image=false;\r
7047                         isImage(scope.profile.img).then(function(img) {\r
7048                             scope.image=img;\r
7049                         });\r
7050                         var splitName=(scope.profile.name).split(' ');\r
7051                         scope.initials='';\r
7052                         for(var i=0;i<splitName.length;i++){\r
7053                             scope.initials += splitName[i][0];\r
7054                         }\r
7055                         if(scope.profile.role.toUpperCase()===profileStatus.role){\r
7056                             scope.badge=true;\r
7057                         }\r
7058                         var profileState=profileStatus.status[scope.profile.state.toUpperCase()];\r
7059                         if(profileState) {\r
7060                             scope.profile.state=profileStatus.status[scope.profile.state.toUpperCase()].status;\r
7061                             scope.colorIcon=profileStatus.status[scope.profile.state.toUpperCase()].color;\r
7062                             if(scope.profile.state.toUpperCase()===profileStatus.status.PENDING.status.toUpperCase()||scope.profile.state.toUpperCase()===profileStatus.status.LOCKED.status.toUpperCase()){\r
7063                                     scope.profile.lastLogin=scope.profile.state;\r
7064                             }\r
7065                         }\r
7066                         var today=new Date().getTime();\r
7067                         var lastlogin=new Date(scope.profile.lastLogin).getTime();\r
7068                         var diff=(today-lastlogin)/(1000*60*60*24);\r
7069                         if(diff<=1){\r
7070                             scope.profile.lastLogin="Today";\r
7071                         }\r
7072                         else if(diff<=2){\r
7073                             scope.profile.lastLogin="Yesterday";\r
7074                         }\r
7075                     }\r
7076                 }\r
7077             };\r
7078         }]);\r
7079 angular.module('att.abs.progressBars', [])\r
7080 \r
7081 .directive('attProgressBar', [function(){\r
7082     return {\r
7083         restrict: 'A',\r
7084         replace: true,\r
7085         templateUrl : 'app/scripts/ng_js_att_tpls/progressBars/progressBars.html'\r
7086     };\r
7087 }]);\r
7088 angular.module('att.abs.radio', [])\r
7089     .constant('attRadioConfig', {\r
7090         activeClass : "att-radio--on",\r
7091         disabledClass : "att-radio--disabled"\r
7092     })\r
7093 .directive('attRadio', ['$compile','attRadioConfig', function ($compile, attRadioConfig) {\r
7094     return {\r
7095         scope: {},\r
7096         restrict: 'A',\r
7097         require: 'ngModel',\r
7098         link: function (scope, element, attr, ctrl) {\r
7099             var ngCtrl = ctrl;\r
7100             scope.radioVal='';\r
7101             var parentDiv = angular.element('<div att-accessibility-click="13,32" ng-click="updateModel($event)" class="att-radio"></div>');\r
7102             element.attr("value",attr.attRadio);\r
7103             element.removeAttr("att-radio");\r
7104             element.removeAttr("title");\r
7105             element.attr("ng-model","radioVal");\r
7106             parentDiv.append(element.prop('outerHTML'));\r
7107             parentDiv.append('<div class="att-radio__indicator"></div>');\r
7108             parentDiv.attr("title", attr.title);\r
7109 \r
7110             var elm = parentDiv.prop('outerHTML');\r
7111             elm = $compile(elm)(scope);\r
7112             element = element.replaceWith(elm);\r
7113             var radioElm = elm.find("input");\r
7114 \r
7115             radioElm.on('focus', function() {                \r
7116                 elm.css("outline","2px solid #5E9ED6");\r
7117                // elm.css("outline","-mos-focus-ring-color auto 5px");\r
7118                 elm.css("outline","-webkit-focus-ring-color auto 5px");\r
7119                \r
7120             });\r
7121             radioElm.on('blur', function() {\r
7122                elm.css("outline","none");\r
7123             });\r
7124 \r
7125             ngCtrl.$render = function () {\r
7126                 scope.radioVal = ngCtrl.$modelValue;\r
7127                 var selected = angular.equals(ngCtrl.$modelValue, attr.attRadio);                \r
7128                 elm.toggleClass(attRadioConfig.activeClass, selected);\r
7129             };\r
7130 \r
7131             scope.updateModel = function () {\r
7132                radioElm[0].focus();\r
7133                 var isActive = elm.hasClass(attRadioConfig.activeClass);\r
7134 \r
7135                 if (!isActive && !scope.disabled) {\r
7136                     ngCtrl.$setViewValue(isActive ? null : attr.attRadio);      \r
7137                     ngCtrl.$render();\r
7138                 }\r
7139             };\r
7140 \r
7141             attr.$observe('disabled', function (val) {\r
7142                 scope.disabled = (val || val === "disabled" || val === "true");\r
7143                 if (scope.disabled){\r
7144                     elm.addClass(attRadioConfig.disabledClass);\r
7145                     elm.attr("tabindex", "-1");\r
7146                 }else { \r
7147                     elm.removeClass(attRadioConfig.disabledClass); \r
7148                     elm.attr("tabindex", "0"); \r
7149                 }\r
7150             });\r
7151         }\r
7152     };\r
7153 }]);\r
7154 angular.module('att.abs.scrollbar', ['att.abs.position'])\r
7155 \r
7156 .constant('attScrollbarConstant', {\r
7157     defaults: {\r
7158         // Vertical or horizontal scrollbar? ( x || y ).\r
7159         axis: 'y',\r
7160         // Whether navigation pane is required of not.\r
7161         navigation: false,\r
7162         // Enable or disable the mousewheel.\r
7163         wheel: true,\r
7164         // How many pixels must the mouswheel scroll at a time.\r
7165         wheelSpeed: 40,\r
7166         // Lock default scrolling window when there is no more content.\r
7167         wheelLock: true,\r
7168         //// Enable invert style scrolling\r
7169         scrollInvert: false,\r
7170         // Set the size of the scrollbar to auto or a fixed number.\r
7171         trackSize: false,\r
7172         // Set the size of the thumb to auto or a fixed number.\r
7173         thumbSize: false,\r
7174         // Set to false to hide the scrollbar if not being used\r
7175         alwaysVisible: true\r
7176     }\r
7177 })\r
7178 \r
7179 .directive('attScrollbar', ['$window', '$timeout', '$parse', '$animate', 'attScrollbarConstant', '$position', function ($window, $timeout, $parse, $animate, attScrollbarConstant, $position) {\r
7180     return {\r
7181         restrict: 'A',\r
7182         scope: true,\r
7183         transclude: true,\r
7184         templateUrl: 'app/scripts/ng_js_att_tpls/scrollbar/scrollbar.html',\r
7185         controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {\r
7186             var defaults = {\r
7187                 axis: $attrs.attScrollbar || attScrollbarConstant.defaults.axis,\r
7188                 navigation: $attrs.navigation || attScrollbarConstant.defaults.navigation,\r
7189                 wheel: attScrollbarConstant.defaults.wheel,\r
7190                 wheelSpeed: attScrollbarConstant.defaults.wheelSpeed,\r
7191                 wheelLock: attScrollbarConstant.defaults.wheelLock,\r
7192                 scrollInvert: attScrollbarConstant.defaults.scrollInvert,\r
7193                 trackSize: attScrollbarConstant.defaults.trackSize,\r
7194                 thumbSize: attScrollbarConstant.defaults.thumbSize,\r
7195                 alwaysVisible: attScrollbarConstant.defaults.alwaysVisible\r
7196             };\r
7197             var options = $attrs.scrollbar;\r
7198             if (options) {\r
7199                 options = $parse(options)($scope);\r
7200             } else {\r
7201                 options = {};\r
7202             }\r
7203             this.options = angular.extend({}, defaults, options);\r
7204             this._defaults = defaults;\r
7205 \r
7206             var self = this,\r
7207                 $body = angular.element(document.querySelectorAll('body')[0]),\r
7208                 $document = angular.element(document),\r
7209                 $viewport = angular.element($element[0].querySelectorAll('.scroll-viewport')[0]),\r
7210                 $overview = angular.element($element[0].querySelectorAll('.scroll-overview')[0]),\r
7211                 $scrollbar = angular.element($element[0].querySelectorAll('.scroll-bar')[0]),\r
7212                 $thumb = angular.element($element[0].querySelectorAll('.scroll-thumb')[0]),\r
7213                 mousePosition = 0,\r
7214                 isHorizontal = this.options.axis === 'x',\r
7215                 hasTouchEvents = false,\r
7216                 // Modern browsers support "wheel"\r
7217                 wheelEvent = ("onwheel" in document ? "wheel" :\r
7218                     // Webkit and IE support at least "mousewheel"\r
7219                     document.onmousewheel !== undefined ? "mousewheel" :\r
7220                     // let's assume that remaining browsers are older Firefox\r
7221                     "DOMMouseScroll"),\r
7222                 sizeLabel = isHorizontal ? 'width' : 'height',\r
7223                 sizeLabelCap = sizeLabel.charAt(0).toUpperCase() + sizeLabel.slice(1).toLowerCase(),\r
7224                 posiLabel = isHorizontal ? 'left' : 'top',\r
7225                 // moveEvent = document.createEvent('HTMLEvents'),\r
7226                 restoreVisibilityAfterWheel,\r
7227                 thumbscrolltouch = false,\r
7228                 documnetscrolltouch = false;\r
7229             if (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {\r
7230                 hasTouchEvents = true;\r
7231             }\r
7232 \r
7233             //moveEvent.initEvent('move', true, true);\r
7234             this.contentPosition = 0;\r
7235             this.viewportSize = 0;\r
7236             this.contentSize = 0;\r
7237             this.contentRatio = 0;\r
7238             this.trackSize = 0;\r
7239             this.trackRatio = 0;\r
7240             this.thumbSize = 0;\r
7241             this.thumbPosition = 0;\r
7242 \r
7243             this.initialize = function () {\r
7244                 if (!this.options.alwaysVisible) {\r
7245                     $scrollbar.css('opacity', 0);\r
7246                 }\r
7247                 self.update();\r
7248                 setEvents();\r
7249                 return self;\r
7250             };\r
7251 \r
7252             this.setSizeData = function () {\r
7253                 this.viewportSize = $viewport.prop('offset' + sizeLabelCap) || 1;\r
7254                 this.contentSize = $overview.prop('scroll' + sizeLabelCap) || 1;\r
7255                 this.contentRatio = this.viewportSize / this.contentSize;\r
7256                 this.trackSize = this.options.trackSize || this.viewportSize;\r
7257                 this.thumbSize = Math.min(this.trackSize, Math.max(0, (this.options.thumbSize || (this.trackSize * this.contentRatio))));\r
7258                 this.trackRatio = this.options.thumbSize ? (this.contentSize - this.viewportSize) / (this.trackSize - this.thumbSize) : (this.contentSize / this.trackSize);\r
7259             };\r
7260 \r
7261             this.update = function (scrollTo) {\r
7262                 self.setSizeData();\r
7263                 mousePosition = $scrollbar.prop('offsetTop');\r
7264 \r
7265                 $scrollbar.toggleClass('disable', this.contentRatio >= 1 || isNaN(this.contentRatio));\r
7266 \r
7267                 if (!this.options.alwaysVisible && this.contentRatio < 1 && this.viewportSize > 0) {\r
7268                     //flash the scrollbar when update happens\r
7269                     $animate.addClass($scrollbar, 'visible').then(function () {\r
7270                         $animate.removeClass($scrollbar, 'visible');\r
7271                         $scope.$digest();\r
7272                     });\r
7273                 }\r
7274 \r
7275                 if (scrollTo !== null) {\r
7276                     if (scrollTo === 'bottom') {\r
7277                         this.contentPosition = this.contentSize - this.viewportSize;\r
7278                     } else {\r
7279                         this.contentPosition = parseInt(scrollTo, 10) || 0;\r
7280                     }\r
7281                 }\r
7282 \r
7283                 ensureContentPosition();\r
7284                 $thumb.css(posiLabel, self.contentPosition / self.trackRatio + 'px');\r
7285                 $scrollbar.css(sizeLabel, self.trackSize + 'px');\r
7286                 $thumb.css(sizeLabel, self.thumbSize + 'px');\r
7287                 $overview.css(posiLabel, -self.contentPosition + 'px');\r
7288 \r
7289                 return this;\r
7290             };\r
7291 \r
7292             fireEvent = function (obj, evt) {\r
7293                 var fireOnThis = obj;\r
7294                 var evtObj;\r
7295                 if (document.createEvent) {\r
7296                     // alert("FF");\r
7297                     evtObj = document.createEvent('HTMLEvents');\r
7298                     evtObj.initEvent(evt, true, false);\r
7299                     fireOnThis.dispatchEvent(evtObj);\r
7300                 } else if (document.createEventObject) {\r
7301                     // alert("IE8");\r
7302                     evtObj = document.createEventObject();\r
7303                     fireOnThis.fireEvent('on' + evt, evtObj);\r
7304                 }\r
7305             };\r
7306 \r
7307             function ensureContentPosition() {\r
7308                 // if scrollbar is on, ensure the bottom of the content does not go above the bottom of the viewport\r
7309                 if (self.contentRatio <= 1 && self.contentPosition > self.contentSize - self.viewportSize) {\r
7310                     self.contentPosition = self.contentSize - self.viewportSize;\r
7311                 }\r
7312                 // if scrollbar is off, ensure the top of the content does not go below the top of the viewport\r
7313                 else if (self.contentRatio > 1 && self.contentPosition > 0) {\r
7314                     self.contentPosition = 0;\r
7315                 }\r
7316 \r
7317                 if (self.contentPosition <= 0) {\r
7318                     $scope.prevAvailable = false;\r
7319                 } else {\r
7320                     $scope.prevAvailable = true;\r
7321                 }\r
7322 \r
7323                 if (self.contentPosition >= (self.contentSize - self.viewportSize)) {\r
7324                     $scope.nextAvailable = false;\r
7325                 } else {\r
7326                     $scope.nextAvailable = true;\r
7327                 }\r
7328             }\r
7329 \r
7330             function setEvents() {\r
7331                 if (hasTouchEvents) {\r
7332                     $viewport.on('touchstart', touchstart);\r
7333                     $thumb.on('touchstart', touchstart);\r
7334                 } else {\r
7335                     $thumb.on('mousedown', start);\r
7336                     $scrollbar.on('mousedown', drag);\r
7337                 }\r
7338 \r
7339                 angular.element($window).on('resize', resize);\r
7340 \r
7341                 if (self.options.wheel) {\r
7342                     $element.on(wheelEvent, wheel);\r
7343                 }\r
7344             }\r
7345 \r
7346             function resize() {\r
7347                 self.update();\r
7348             }\r
7349 \r
7350             function touchstart(event) {\r
7351                 if (1 === event.touches.length) {\r
7352                     event.stopPropagation();\r
7353                     start(event.touches[0]);\r
7354                 }\r
7355             }\r
7356 \r
7357             function start(event) {\r
7358                 $body.addClass('scroll-no-select');\r
7359                 $element.addClass('scroll-no-select');\r
7360 \r
7361                 if (!self.options.alwaysVisible) {\r
7362                     $scrollbar.addClass('visible');\r
7363                 }\r
7364                 mousePosition = isHorizontal ? event.clientX : event.clientY;\r
7365                 self.thumbPosition = parseInt($thumb.css(posiLabel), 10) || 0;\r
7366 \r
7367                 if (hasTouchEvents) {\r
7368                     documnetscrolltouch = false;\r
7369                     thumbscrolltouch = false;\r
7370                     $viewport.on('touchmove', touchdrag);\r
7371                     $viewport.on('touchend', end);\r
7372                     $thumb.on('touchmove', touchdragthumb);\r
7373                     $thumb.on('touchend', end);\r
7374                 } else {\r
7375                     $document.on('mousemove', drag);\r
7376                     $document.on('mouseup', end);\r
7377                     $thumb.on('mouseup', end);\r
7378                 }\r
7379             }\r
7380 \r
7381             function wheel(event) {\r
7382                 if (self.contentRatio >= 1) {\r
7383                     return;\r
7384                 }\r
7385 \r
7386                 if (!self.options.alwaysVisible) {\r
7387                     //cancel removing visibility if wheel event is triggered before the timeout\r
7388                     if (restoreVisibilityAfterWheel) {\r
7389                         $timeout.cancel(restoreVisibilityAfterWheel);\r
7390                     }\r
7391                     $scrollbar.addClass('visible');\r
7392 \r
7393                     restoreVisibilityAfterWheel = $timeout(function () {\r
7394                         $scrollbar.removeClass('visible');\r
7395                     }, 100);\r
7396                 }\r
7397 \r
7398                 var evntObj = (event && event.originalEvent) || event || $window.event,\r
7399                     deltaDir = self.options.axis.toUpperCase(),\r
7400                     delta = {\r
7401                         X: evntObj.deltaX || 0,\r
7402                         Y: evntObj.deltaY || 0\r
7403                     },\r
7404                     wheelSpeed = evntObj.deltaMode === 0 ? self.options.wheelSpeed : 1;\r
7405 \r
7406                 if (self.options.scrollInvert) {\r
7407                     wheelSpeed *= -1;\r
7408                 }\r
7409 \r
7410                 if (wheelEvent === 'mousewheel') {\r
7411                     delta.Y = -1 * evntObj.wheelDelta / 40;\r
7412                     if (evntObj.wheelDeltaX) {\r
7413                         delta.X = -1 * evntObj.wheelDeltaX / 40;\r
7414                     }\r
7415                 }\r
7416                 delta.X *= -1 / wheelSpeed;\r
7417                 delta.Y *= -1 / wheelSpeed;\r
7418 \r
7419                 var wheelSpeedDelta = delta[deltaDir];\r
7420 \r
7421                 self.contentPosition -= wheelSpeedDelta * self.options.wheelSpeed;\r
7422                 self.contentPosition = Math.min((self.contentSize - self.viewportSize), Math.max(0, self.contentPosition));\r
7423 \r
7424                 fireEvent($element[0], 'move');\r
7425 \r
7426                 ensureContentPosition();\r
7427                 $thumb.css(posiLabel, self.contentPosition / self.trackRatio + 'px');\r
7428                 $overview.css(posiLabel, -self.contentPosition + 'px');\r
7429 \r
7430                 if (self.options.wheelLock || (self.contentPosition !== (self.contentSize - self.viewportSize) && self.contentPosition !== 0)) {\r
7431                     evntObj.preventDefault();\r
7432                 }\r
7433 \r
7434                 $scope.$apply();\r
7435             }\r
7436 \r
7437             function touchdrag(event) {\r
7438                 event.preventDefault();\r
7439                 documnetscrolltouch = true;\r
7440                 drag(event.touches[0]);\r
7441             }\r
7442 \r
7443             function touchdragthumb(event) {\r
7444                 event.preventDefault();\r
7445                 thumbscrolltouch = true;\r
7446                 drag(event.touches[0]);\r
7447             }\r
7448 \r
7449             function drag(event) {\r
7450                 if (self.contentRatio >= 1) {\r
7451                     return;\r
7452                 }\r
7453 \r
7454                 var mousePositionNew = isHorizontal ? event.clientX : event.clientY,\r
7455                     thumbPositionDelta = mousePositionNew - mousePosition;\r
7456 \r
7457                 if ((self.options.scrollInvert && !hasTouchEvents) ||\r
7458                     (hasTouchEvents && !self.options.scrollInvert)) {\r
7459                     thumbPositionDelta = mousePosition - mousePositionNew;\r
7460                 }\r
7461                 if (documnetscrolltouch && hasTouchEvents) {\r
7462                     thumbPositionDelta = mousePosition - mousePositionNew;\r
7463                 }\r
7464                 if (thumbscrolltouch && hasTouchEvents) {\r
7465                     thumbPositionDelta = mousePositionNew - mousePosition;\r
7466                 }\r
7467                 var thumbPositionNew = Math.min((self.trackSize - self.thumbSize), Math.max(0, self.thumbPosition + thumbPositionDelta));\r
7468                 self.contentPosition = thumbPositionNew * self.trackRatio;\r
7469 \r
7470                 fireEvent($element[0], 'move');\r
7471 \r
7472                 ensureContentPosition();\r
7473                 $thumb.css(posiLabel, thumbPositionNew + 'px');\r
7474                 $overview.css(posiLabel, -self.contentPosition + 'px');\r
7475 \r
7476                 $scope.$apply();\r
7477             }\r
7478 \r
7479             $scope.customScroll = function (direction) {\r
7480                 if (self.contentRatio >= 1) {\r
7481                     return;\r
7482                 }\r
7483 \r
7484                 var customScrollDelta;\r
7485                 var viewportDimension = $position.position($viewport);\r
7486 \r
7487                 if (isHorizontal) {\r
7488                     customScrollDelta = viewportDimension.width;\r
7489                 } else {\r
7490                     customScrollDelta = viewportDimension.height;\r
7491                 }\r
7492 \r
7493                 if (direction) {\r
7494                     self.contentPosition += customScrollDelta;\r
7495                 } else {\r
7496                     self.contentPosition -= customScrollDelta;\r
7497                 }\r
7498                 self.contentPosition = Math.min((self.contentSize - self.viewportSize), Math.max(0, self.contentPosition));\r
7499 \r
7500                 fireEvent($element[0], 'move');\r
7501 \r
7502                 ensureContentPosition();\r
7503                 $thumb.css(posiLabel, self.contentPosition / self.trackRatio + 'px');\r
7504                 $overview.css(posiLabel, -self.contentPosition + 'px');\r
7505             };\r
7506 \r
7507             function end() {\r
7508                 $body.removeClass('scroll-no-select');\r
7509                 $element.removeClass('scroll-no-select');\r
7510                 if (!self.options.alwaysVisible) {\r
7511                     $scrollbar.removeClass('visible');\r
7512                 }\r
7513                 $document.off('mousemove', drag);\r
7514                 $document.off('mouseup', end);\r
7515                 $thumb.off('mouseup', end);\r
7516                 $document.off('touchmove', touchdrag);\r
7517                 $document.off('ontouchend', end);\r
7518                 $thumb.off('touchmove', touchdragthumb);\r
7519                 $thumb.off('touchend', end);\r
7520             }\r
7521 \r
7522             this.cleanup = function () {\r
7523                 $viewport.off('touchstart', touchstart);\r
7524                 $thumb.off('mousedown', start);\r
7525                 $scrollbar.off('mousedown', drag);\r
7526                 $thumb.off('touchmove', touchdragthumb);\r
7527                 $thumb.off('touchend', end);\r
7528                 angular.element($window).off('resize', resize);\r
7529                 $element.off(wheelEvent, wheel);\r
7530                 //ensure scrollbar isn't activated\r
7531                 self.options.alwaysVisible = true;\r
7532                 end();\r
7533             };\r
7534         }],\r
7535         link: function (scope, iElement, iAttrs, controller) {\r
7536             scope.navigation = controller.options.navigation;\r
7537             scope.viewportHeight = iAttrs.viewportHeight;\r
7538             scope.viewportWidth = iAttrs.viewportWidth;\r
7539             scope.scrollbarAxis = controller.options.axis;\r
7540             if (scope.scrollbarAxis === 'x') {\r
7541                 iElement.addClass('horizontal');\r
7542             } else if (scope.scrollbarAxis === 'y') {\r
7543                 iElement.addClass('vertical');\r
7544             }\r
7545 \r
7546             var position = iElement.css('position');\r
7547             if (position !== 'relative' && position !== 'absolute') {\r
7548                 iElement.css('position', 'relative');\r
7549             }\r
7550 \r
7551             scope.$watch(function () {\r
7552                 $timeout(refreshScrollbar, 100, false);\r
7553             });\r
7554 \r
7555             var refreshScrollbar = function () {\r
7556                 var $overview = angular.element(iElement[0].querySelectorAll('.scroll-overview')[0]);\r
7557                 var newValue = $overview.prop('scrollHeight');\r
7558                 var oldValue = scope.oldValue;\r
7559                 if (newValue !== oldValue) {\r
7560                     scope.oldValue = newValue;\r
7561                     controller.update();\r
7562                 }\r
7563             };\r
7564 \r
7565             controller.initialize();\r
7566             iElement.on('$destroy', function () {\r
7567                 controller.cleanup();\r
7568             });\r
7569         }\r
7570     };\r
7571 }]);\r
7572 \r
7573 angular.module('att.abs.search', ['att.abs.utilities', 'att.abs.position', 'att.abs.utilities'])\r
7574 .directive('attSearch', ['$document', '$filter', '$isElement', '$documentBind', '$timeout', '$log', 'keymap', function($document, $filter, $isElement, $documentBind, $timeout, $log, keymap){\r
7575     return{\r
7576         restrict: 'A',\r
7577         scope:{cName: '=attSearch'},\r
7578         transclude: false,\r
7579         replace: false,\r
7580         require:'ngModel',\r
7581         templateUrl: 'app/scripts/ng_js_att_tpls/search/search.html',\r
7582         link: function(scope, element, attr, ctrl) {\r
7583             scope.selectedIndex = -1;\r
7584             scope.selectedOption = attr.placeholder;\r
7585             scope.isDisabled = false;\r
7586             scope.className = "select2-match";\r
7587             scope.showSearch = false;\r
7588             scope.showlist = false;\r
7589 \r
7590             // This is used to jump to elements in list\r
7591             var search = '';\r
7592             // This is used to ensure searches only persist so many ms.\r
7593             var prevSearchDate = new Date();\r
7594             // This is used to shift focus back after closing dropdown\r
7595             var dropdownElement = undefined;\r
7596             // Used to ensure focus on dropdown elements\r
7597             var list = [];\r
7598             $timeout(function() {\r
7599                 list = element.find('li');\r
7600             }, 10);\r
7601 \r
7602             $log.warn('attSearch is deprecated, please use attSelect instead. This component will be removed by version 2.7.')\r
7603                         //scope.noFilter = true;\r
7604             if (attr.noFilter || attr.noFilter === 'true') {\r
7605                 scope.noFilter = true;\r
7606             } else {\r
7607                 scope.noFilter = false;\r
7608             }\r
7609             if (attr.placeholderAsOption === 'false') {\r
7610                 //scope.selectMsg = '';\r
7611                 scope.selectedOption = attr.placeholder;\r
7612             } else {\r
7613                 scope.selectMsg = attr.placeholder;\r
7614             }\r
7615             if (attr.startsWithFilter || attr.startsWithFilter === 'true') {\r
7616                 scope.startsWithFilter = true;\r
7617             }\r
7618             if (attr.showInputFilter === 'true') {\r
7619                 scope.showSearch = false;\r
7620                 $log.warn('showInputFilter functionality has been removed from the library.');\r
7621                 // This is deprecated\r
7622             }\r
7623             if (attr.disabled) {\r
7624                 scope.isDisabled = true;\r
7625             }\r
7626             dropdownElement = angular.element(element).children().eq(0).find('a')[0];\r
7627             var prevIndex = 0;\r
7628             var selectOptionFromSearch = function() {\r
7629                 if (!scope.noFilter) {\r
7630                     return;\r
7631                 }\r
7632 \r
7633                 // Find next element that matches search criteria. \r
7634                 // If no element is found, loop to beginning and search.\r
7635                 var criteria = search;\r
7636                 var i = 0;\r
7637                 for (i = prevIndex; i < scope.cName.length; i++) {\r
7638                     // Need to ensure we keep searching until all startsWith have passed before looping\r
7639                     if (scope.cName[i].title.startsWith(criteria) && i !== scope.selectedIndex) {\r
7640                         scope.selectOption(scope.cName[i], i, scope.showlist);\r
7641                         prevIndex = i;\r
7642                         search = '';\r
7643                         break;\r
7644                     }\r
7645                 }\r
7646                 if ((i >= scope.cName.length || !scope.cName[i+1].title.startsWith(criteria)) && prevIndex > 0) {\r
7647                     prevIndex = 0;\r
7648                 }\r
7649             };\r
7650             scope.showDropdown = function() {\r
7651                 if (!(attr.disabled)) {\r
7652                     scope.showlist = !scope.showlist;\r
7653                     scope.setSelectTop();\r
7654                 }\r
7655             };\r
7656             element.bind('keydown', function(e) {\r
7657                 if (keymap.isAllowedKey(e.keyCode) || keymap.isControl(e) || keymap.isFunctionKey(e)) {\r
7658                     e.preventDefault();\r
7659                     e.stopPropagation();\r
7660 \r
7661                     switch (e.keyCode) {\r
7662                         case keymap.KEY.DOWN:\r
7663                             scope.selectNext();\r
7664                             break;\r
7665                         case keymap.KEY.UP:\r
7666                             scope.selectPrev();\r
7667                             search = '';\r
7668                             break;\r
7669                         case keymap.KEY.ENTER:\r
7670                             scope.selectCurrent();\r
7671                             search = '';\r
7672                             break;\r
7673                         case keymap.KEY.BACKSPACE:\r
7674                             scope.title = '';\r
7675                             search = '';\r
7676                             scope.$apply();\r
7677                             break;\r
7678                         case keymap.KEY.SPACE:\r
7679                             if (!scope.noFilter) {\r
7680                                 scope.title += ' ';\r
7681                             }\r
7682                             scope.$apply();\r
7683                             break;\r
7684                         case keymap.KEY.ESC:\r
7685                             if (scope.title === '' || scope.title === undefined) {\r
7686                                 scope.showlist = false;\r
7687                                 dropdownElement.focus();\r
7688                                 scope.$apply();\r
7689                             } else {\r
7690                                 scope.title = '';\r
7691                                 scope.$apply();\r
7692                             }\r
7693                             if (scope.noFilter) {\r
7694                                 search = '';\r
7695                                 dropdownElement.focus();\r
7696                                 scope.showlist = false;\r
7697                             }\r
7698                             break;\r
7699                         default:\r
7700                             break;\r
7701                     }\r
7702                 } else {\r
7703                     if (e.keyCode !== 9)\r
7704                     {\r
7705                         if (!scope.noFilter) {\r
7706                             scope.showlist = true;\r
7707                             scope.title = scope.title ? scope.title + String.fromCharCode(e.keyCode) : String.fromCharCode(e.keyCode);\r
7708                         } else {\r
7709                             var date = new Date();\r
7710                             var delta = Math.abs(prevSearchDate.getMilliseconds() - date.getMilliseconds());\r
7711                             prevSearchDate = date;\r
7712                             if (delta > 100) {\r
7713                                 search = '';\r
7714                             }\r
7715                             search = search ? search + String.fromCharCode(e.keyCode) : String.fromCharCode(e.keyCode);\r
7716                             if (search.length > 2) {\r
7717                                 search = search.substring(0, 2);\r
7718                             }\r
7719                             selectOptionFromSearch();\r
7720                         }\r
7721                         scope.$apply();\r
7722                     } else if (e.keyCode === 9) {\r
7723                         scope.showlist = false;\r
7724                         scope.title = '';\r
7725                         scope.$apply();\r
7726                     }\r
7727                 }\r
7728             });\r
7729             scope.selectOption = function(sTitle, sIndex, keepOpen) {\r
7730                 if (sIndex === -1 || sIndex === '-1') {\r
7731                     scope.selCategory = '';\r
7732                     scope.selectedIndex = -1;\r
7733                     ctrl.$setViewValue('');\r
7734                     if(attr.placeholderAsOption !== 'false')\r
7735                     {\r
7736                         scope.selectedOption = scope.selectMsg;\r
7737                     }\r
7738                 } else {\r
7739                     scope.selCategory = scope.cName[sIndex];\r
7740                     scope.selectedIndex = sIndex;\r
7741                     ctrl.$setViewValue(scope.selCategory);\r
7742                     scope.selectedOption = scope.selCategory.title;\r
7743                     if (angular.isDefined(list[sIndex])) {\r
7744                         list[sIndex].focus();\r
7745                     }\r
7746                 }\r
7747                 scope.title = '';\r
7748                 if (!keepOpen) {\r
7749                     scope.showlist = false;\r
7750                     dropdownElement.focus();\r
7751                 }\r
7752                 scope.$apply();\r
7753             };\r
7754             scope.selectCurrent = function() {\r
7755                 if (scope.showlist) {\r
7756                     scope.selectOption(scope.selectMsg, scope.selectedIndex, false);\r
7757                     scope.$apply();\r
7758                 } else {\r
7759                     scope.showlist = true;\r
7760                     scope.setSelectTop();\r
7761                     scope.$apply();\r
7762                 }\r
7763             };\r
7764             scope.hoverIn = function(cItem) {\r
7765                 scope.selectedIndex = cItem;\r
7766                 scope.focusme();\r
7767             };\r
7768             scope.setSelectTop = function() {\r
7769                 $timeout(function() {\r
7770                     if (scope.showlist && !scope.noFilter)\r
7771                     {\r
7772                         var containerUL = angular.element(element)[0].querySelector(".select2-results");\r
7773                         if(angular.element(containerUL.querySelector('.select2-result-current'))[0])\r
7774                         {\r
7775                             var selectedElemTopPos = angular.element(containerUL.querySelector('.select2-result-current'))[0].offsetTop;\r
7776                         }\r
7777                         angular.element(containerUL)[0].scrollTop = selectedElemTopPos;\r
7778                     }\r
7779                 });\r
7780             };\r
7781             scope.setCurrentTop = function() {\r
7782                 $timeout(function() {\r
7783                     if (scope.showlist) {\r
7784                         var containerUL = angular.element(element)[0].querySelector(".select2-results");\r
7785                         if(angular.element(containerUL.querySelector('.hovstyle'))[0])\r
7786                         {\r
7787                             var selectedElemTopPos = angular.element(containerUL.querySelector('.hovstyle'))[0].offsetTop;\r
7788                         }\r
7789                         if (selectedElemTopPos < (angular.element(containerUL)[0].scrollTop)) {\r
7790                             angular.element(containerUL)[0].scrollTop -= 30;\r
7791                         } else if ((selectedElemTopPos + 30) > (angular.element(containerUL)[0].clientHeight)) {\r
7792                             angular.element(containerUL)[0].scrollTop += 30;\r
7793                         }\r
7794 \r
7795                     }\r
7796                 });\r
7797             };\r
7798             scope.selectNext = function() {\r
7799                 if ((scope.selectedIndex + 1) <= (scope.cName.length - 1)) {\r
7800                     scope.selectedIndex += 1;\r
7801                     if (!scope.showlist) {\r
7802                         scope.selectOption(scope.selectMsg, scope.selectedIndex, false);\r
7803                     }\r
7804                     scope.focusme();\r
7805                     scope.$apply();\r
7806                 }\r
7807                 scope.setCurrentTop();\r
7808             };\r
7809             scope.selectPrev = function() {\r
7810                 if ((scope.selectedIndex - 1) >= 0) {\r
7811                     scope.selectedIndex -= 1;\r
7812                     if (!scope.showlist) {\r
7813                         scope.selectOption(scope.selectMsg, scope.selectedIndex, false);\r
7814                     }\r
7815                     scope.focusme();\r
7816                     scope.$apply();\r
7817                 } else if (scope.selectedIndex - 1 < 0) {\r
7818                     // If placeholderAsOption is true or undefined (default), ensure we can select it on up key.\r
7819                     if (attr.placeholderAsOption === undefined || attr.placeholderAsOption === 'true') {\r
7820                         scope.selectedIndex = -1;\r
7821                     } else {\r
7822                         scope.selectedIndex = 0;\r
7823                     }\r
7824                     if (!scope.showlist) {\r
7825                         scope.selectOption(scope.selectMsg, scope.selectedIndex, false);\r
7826                     }\r
7827                     scope.focusme();\r
7828                     scope.$apply();\r
7829                 }\r
7830                 scope.setCurrentTop();\r
7831             };\r
7832             scope.updateSelection = function(sItem) {\r
7833                 scope.selectedOption = sItem.title;\r
7834                 scope.title = "";\r
7835             };\r
7836             scope.focusme = function() {\r
7837                 $timeout(function() {\r
7838                     var list = angular.element(element).find('ul').find('li');\r
7839                     var index = scope.selectedIndex + 2;\r
7840                     if (scope.noFilter) {\r
7841                         index = scope.selectedIndex;\r
7842                     }\r
7843                     if (angular.isDefined(list[index])) {\r
7844                         list[index].focus();\r
7845                     }\r
7846                 });\r
7847             };\r
7848             scope.$watch('selCategory', function(value) {\r
7849                 if (value) {\r
7850                     scope.updateSelection(value);\r
7851                 };\r
7852             });\r
7853             ctrl.$viewChangeListeners.push(function() {\r
7854                 scope.$eval(attr.ngChange);\r
7855             });\r
7856             ctrl.$render = function() {\r
7857                 scope.selCategory = ctrl.$viewValue;\r
7858             };\r
7859             var outsideClick = function(e) {\r
7860                 var isElement = $isElement(angular.element(e.target), element, $document);\r
7861                 if (!isElement) {\r
7862                     scope.showlist = false;\r
7863                     dropdownElement.focus();\r
7864                     scope.$apply();\r
7865                 }\r
7866             };\r
7867             $documentBind.click('showlist', outsideClick, scope);\r
7868         }\r
7869     };\r
7870 }]);\r
7871 angular.module('att.abs.select', ['att.abs.utilities', 'att.abs.position', 'att.abs.utilities'])\r
7872 .directive('attSelect', ["$document", "$filter", "$isElement", '$documentBind', '$timeout', 'keymap', '$log', function($document, $filter, $isElement, $documentBind, $timeout, keymap, $log) {\r
7873     return {\r
7874         restrict: 'A',\r
7875         scope: {\r
7876             cName: '=attSelect'\r
7877         },\r
7878         transclude: false,\r
7879         replace: false,\r
7880         require: 'ngModel',\r
7881         templateUrl: 'app/scripts/ng_js_att_tpls/select/select.html',\r
7882         link: function(scope, element, attr, ctrl) {\r
7883             scope.selectedIndex = -1;\r
7884             scope.selectedOption = attr.placeholder;\r
7885             scope.isDisabled = false;\r
7886             scope.className = "select2-match";\r
7887             scope.showSearch = false;\r
7888             scope.showlist = false;\r
7889                         scope.titleName = attr.titlename;\r
7890             scope.$watch('ngModel', function() {\r
7891                // console.log('sv:', ctrl.$modelValue);\r
7892             });\r
7893 \r
7894             // This is used to jump to elements in list\r
7895             var search = '';\r
7896             // This is used to ensure searches only persist so many ms.\r
7897             var prevSearchDate = new Date();\r
7898             // This is used to shift focus back after closing dropdown\r
7899             var dropdownElement = undefined;\r
7900             // Used to ensure focus on dropdown elements\r
7901             var list = [];\r
7902             $timeout(function() {\r
7903                 list = element.find('li');\r
7904             }, 10);\r
7905                         //scope.noFilter = true;\r
7906             if (attr.noFilter || attr.noFilter === 'true') {\r
7907                 scope.noFilter = true;\r
7908             } else {\r
7909                 scope.noFilter = false;\r
7910             }\r
7911             if (attr.placeholderAsOption === 'false') {\r
7912                 scope.selectedOption = attr.placeholder;\r
7913             } else {\r
7914                 scope.selectMsg = attr.placeholder;\r
7915             }\r
7916             if (attr.startsWithFilter || attr.startsWithFilter === 'true') {\r
7917                 scope.startsWithFilter = true;\r
7918             }\r
7919             if (attr.showInputFilter === 'true') {\r
7920                 scope.showSearch = false;\r
7921                 /* This is deprecated */\r
7922                 $log.warn('showInputFilter functionality has been removed from the library.');   \r
7923             }\r
7924             if (attr.disabled) {\r
7925                 scope.isDisabled = true;\r
7926             }\r
7927             var getFilterType = function() {\r
7928                 if (scope.startsWithFilter) {\r
7929                     return 'startsWith';\r
7930                 } else {\r
7931                     return 'filter';\r
7932                 }\r
7933             };\r
7934             dropdownElement = angular.element(element).children().eq(0).find('span')[0];\r
7935             var prevIndex = 0;\r
7936             var selectOptionFromSearch = function() {\r
7937                 if (!scope.noFilter) {\r
7938                     return;\r
7939                 }\r
7940 \r
7941                 // Find next element that matches search criteria.\r
7942                 // If no element is found, loop to beginning and search.\r
7943                 var criteria = search;\r
7944                 var i = 0;\r
7945                 for (i = prevIndex; i < scope.cName.length; i++) {\r
7946                     // Need to ensure we keep searching until all startsWith have passed before looping\r
7947                     if (scope.cName[i].title.startsWith(criteria) && i !== scope.selectedIndex) {\r
7948                         scope.selectOption(scope.cName[i], i, scope.showlist);\r
7949                         prevIndex = i;\r
7950                         search = '';\r
7951                         break;\r
7952                     }\r
7953                 }\r
7954                 if ((i >= scope.cName.length || !scope.cName[i+1].title.startsWith(criteria)) && prevIndex > 0) {\r
7955                     prevIndex = 0;\r
7956                 }\r
7957             };\r
7958             scope.showDropdown = function() {\r
7959                 if (!(attr.disabled)) {\r
7960                     scope.showlist = !scope.showlist;\r
7961                     scope.setSelectTop();\r
7962                     /* Ensure selected element is focused upon opening dropdown */\r
7963                     scope.focusme();\r
7964                 }\r
7965             };\r
7966             element.bind('keydown', function(e) {\r
7967                 if (keymap.isAllowedKey(e.keyCode) || keymap.isControl(e) || keymap.isFunctionKey(e)) {\r
7968                     e.preventDefault();\r
7969                     e.stopPropagation();\r
7970 \r
7971                     switch (e.keyCode) {\r
7972                         case keymap.KEY.DOWN:\r
7973                             scope.selectNext();\r
7974                             break;\r
7975                         case keymap.KEY.UP:\r
7976                             scope.selectPrev();\r
7977                             search = '';\r
7978                             break;\r
7979                         case keymap.KEY.ENTER:\r
7980                             scope.selectCurrent();\r
7981                             search = '';\r
7982                             break;\r
7983                         case keymap.KEY.BACKSPACE:\r
7984                             scope.title = '';\r
7985                             search = '';\r
7986                             scope.$apply();\r
7987                             break;\r
7988                         case keymap.KEY.SPACE:\r
7989                             if (!scope.noFilter) {\r
7990                                 scope.title += ' ';\r
7991                             }\r
7992                             scope.$apply();\r
7993                             break;\r
7994                         case keymap.KEY.ESC:\r
7995                             if (scope.title === '' || scope.title === undefined) {\r
7996                                 scope.showlist = false;\r
7997                                 dropdownElement.focus();\r
7998                                 scope.$apply();\r
7999                             } else {\r
8000                                 scope.title = '';\r
8001                                 scope.$apply();\r
8002                             }\r
8003                             if (scope.noFilter) {\r
8004                                 search = '';\r
8005                                 dropdownElement.focus();\r
8006                                 scope.showlist = false;\r
8007                             }\r
8008                             break;\r
8009                         default:\r
8010                             break;\r
8011                     }\r
8012                 } else {\r
8013                     if (e.keyCode !== keymap.KEY.TAB)\r
8014                     {\r
8015                         if (!scope.noFilter) {\r
8016                             scope.showlist = true;\r
8017                             scope.title = scope.title ? scope.title + String.fromCharCode(e.keyCode) : String.fromCharCode(e.keyCode);\r
8018 \r
8019                             /* Perform index correction */\r
8020                             if (scope.title != '') {\r
8021                                 var filteredArray = $filter(getFilterType())(scope.cName, scope.title);\r
8022 \r
8023                                 for (var i = 0; i < filteredArray.length; i++) {\r
8024                                     for (var j = 0; j < scope.cName.length; j++) {\r
8025                                         if (!angular.isDefined(scope.cName[scope.selectedIndex])) {\r
8026                                             break;\r
8027                                         }\r
8028                                         if (filteredArray[i]['title'] === scope.cName[scope.selectedIndex]['title']) {\r
8029                                             scope.selectedIndex = i;\r
8030                                             scope.focusme();\r
8031                                             break;\r
8032                                         }\r
8033                                     }\r
8034                                 }\r
8035                             }\r
8036                         } else {\r
8037                             var date = new Date();\r
8038                             var delta = Math.abs(prevSearchDate.getMilliseconds() - date.getMilliseconds());\r
8039                             prevSearchDate = date;\r
8040                             if (delta > 100) {\r
8041                                 search = '';\r
8042                             }\r
8043                             search = search ? search + String.fromCharCode(e.keyCode) : String.fromCharCode(e.keyCode);\r
8044                             if (search.length > 2) {\r
8045                                 search = search.substring(0, 2);\r
8046                             }\r
8047                             selectOptionFromSearch();\r
8048                         }\r
8049                         scope.$apply();\r
8050                     } else if (e.keyCode === keymap.KEY.TAB) {\r
8051                         scope.showlist = false;\r
8052                         scope.title = '';\r
8053                         scope.$apply();\r
8054                     }\r
8055                 }\r
8056             });\r
8057             scope.selectOption = function(sTitle, sIndex, keepOpen) {\r
8058 \r
8059                 if (sIndex === -1 || sIndex === '-1') {\r
8060                     scope.selCategory = '';\r
8061                     scope.selectedIndex = -1;\r
8062                     ctrl.$setViewValue('');\r
8063                     if(attr.placeholderAsOption !== 'false')\r
8064                     {\r
8065                         scope.selectedOption = scope.selectMsg;\r
8066                     }\r
8067                 }\r
8068                 else {\r
8069                     /* Apply filter here to remap the selected index and shift focus*/\r
8070                     if (scope.title != '') {\r
8071                         var filteredArray = $filter(getFilterType())(scope.cName, scope.title);\r
8072 \r
8073                         if (angular.isDefined(filteredArray) && angular.isDefined(filteredArray[sIndex]))\r
8074                         {\r
8075                             for (var i = 0; i < scope.cName.length; i++) {\r
8076                                 if (filteredArray[sIndex]['title'] === scope.cName[i]['title']) {\r
8077                                     sIndex = i;\r
8078                                     break;\r
8079                                 }\r
8080                             }\r
8081                         }\r
8082                     }\r
8083                     scope.selCategory = scope.cName[sIndex];\r
8084                     scope.selectedIndex = sIndex;\r
8085                     ctrl.$setViewValue(scope.selCategory);\r
8086                     scope.selectedOption = scope.selCategory.title;\r
8087                     ctrl.$render();\r
8088 \r
8089                     $timeout(function(){\r
8090                         if (angular.isDefined(list[sIndex])) {\r
8091                             try{\r
8092                                 list[index].focus();\r
8093                             } catch (e) {} /* IE8 will throw exception if display:none or not in DOM */\r
8094                         }\r
8095                     });\r
8096                 }\r
8097                 scope.title = '';\r
8098                 if (!keepOpen) {\r
8099                     scope.showlist = false;\r
8100                     dropdownElement.focus();\r
8101                 }\r
8102             };\r
8103             scope.selectCurrent = function() {\r
8104                 if (scope.showlist) {\r
8105                     scope.selectOption(scope.selectMsg,scope.selectedIndex,false);\r
8106                 } else {\r
8107                     scope.showlist = true;\r
8108                     scope.setSelectTop();\r
8109                 }\r
8110                 scope.$apply();\r
8111             };\r
8112             scope.hoverIn = function(cItem) {\r
8113                 scope.selectedIndex = cItem;\r
8114                 scope.focusme();\r
8115             };\r
8116             scope.setSelectTop = function() {\r
8117                 $timeout(function() {\r
8118                     if (scope.showlist && !scope.noFilter)\r
8119                     {\r
8120                         var containerUL = angular.element(element)[0].querySelector(".select2-results");\r
8121                         if(angular.element(containerUL.querySelector('.select2-result-current'))[0])\r
8122                         {\r
8123                             var selectedElemTopPos = angular.element(containerUL.querySelector('.select2-result-current'))[0].offsetTop;\r
8124                         }\r
8125                         angular.element(containerUL)[0].scrollTop = selectedElemTopPos;\r
8126                     }\r
8127                 });\r
8128             };\r
8129             scope.setCurrentTop = function() {\r
8130                 $timeout(function() {\r
8131                     if (scope.showlist) {\r
8132                         var containerUL = angular.element(element)[0].querySelector(".select2-results");\r
8133                         if(angular.element(containerUL.querySelector('.hovstyle'))[0])\r
8134                         {\r
8135                             var selectedElemTopPos = angular.element(containerUL.querySelector('.hovstyle'))[0].offsetTop;\r
8136                         }\r
8137                         if (selectedElemTopPos < (angular.element(containerUL)[0].scrollTop)) {\r
8138                             angular.element(containerUL)[0].scrollTop -= 30;\r
8139                         } else if ((selectedElemTopPos + 30) > (angular.element(containerUL)[0].clientHeight)) {\r
8140                             angular.element(containerUL)[0].scrollTop += 30;\r
8141                         }\r
8142 \r
8143                     }\r
8144                 });\r
8145             };\r
8146             scope.selectNext = function() {\r
8147                 var length = scope.cName.length;\r
8148                 \r
8149                 if ((scope.selectedIndex + 1) <= (scope.cName.length - 1)) {\r
8150                     scope.selectedIndex += 1;\r
8151                     var nextDisabled = scope.cName[scope.selectedIndex].disabled;\r
8152                     if (nextDisabled) {\r
8153                         scope.selectedIndex += 1;\r
8154                     }\r
8155                     if (!scope.showlist) {\r
8156                         scope.selectOption(scope.selectMsg, scope.selectedIndex,false);\r
8157                     }\r
8158                     scope.focusme();\r
8159                     scope.$apply();\r
8160                 }\r
8161                 scope.setCurrentTop();\r
8162             };\r
8163             scope.selectPrev = function() {\r
8164                 if ((scope.selectedIndex - 1) >= 0) {\r
8165                     scope.selectedIndex -= 1;\r
8166                     var prevDisabled = scope.cName[scope.selectedIndex].disabled;\r
8167                     if (prevDisabled) {\r
8168                         scope.selectedIndex -= 1;\r
8169                     }\r
8170                     if (!scope.showlist) {\r
8171                         scope.selectOption(scope.selectMsg, scope.selectedIndex,false);\r
8172                     }\r
8173                     scope.focusme();\r
8174                     scope.$apply();\r
8175                 } else if (scope.selectedIndex - 1 < 0) {\r
8176                     // If placeholderAsOption is true or undefined (default), ensure we can select it on up key.\r
8177                     if (attr.placeholderAsOption === undefined || attr.placeholderAsOption === 'true') {\r
8178                         if(attr.placeholder === undefined ){\r
8179                             scope.selectedIndex = 0;\r
8180                         }\r
8181                         else{\r
8182                             scope.selectedIndex = -1;\r
8183                         }\r
8184                     } else {\r
8185                         scope.selectedIndex = 0;\r
8186                     }\r
8187                     if (!scope.showlist) {\r
8188                         scope.selectOption(scope.selectMsg, scope.selectedIndex,false);\r
8189                     }\r
8190                     scope.focusme();\r
8191                     scope.$apply();\r
8192                 }\r
8193                 scope.setCurrentTop();\r
8194             };\r
8195             scope.updateSelection = function(sItem) {\r
8196                 scope.selectedOption = sItem.title;\r
8197                 scope.title = '';\r
8198 \r
8199                 if (sItem.index < 0) {\r
8200                     scope.selectOption(scope.selectMsg, sItem.index, scope.showlist);\r
8201                 }\r
8202             };\r
8203             scope.focusme = function() {\r
8204                 $timeout(function() {\r
8205                     var list = angular.element(element).find('ul').find('li');\r
8206                     var index = scope.selectedIndex + 2;\r
8207                     if (scope.noFilter) {\r
8208                         index = scope.selectedIndex;\r
8209                     }\r
8210                     if (angular.isDefined(list[index])) {\r
8211                         try {\r
8212                             list[index].focus();\r
8213                         } catch (e) {} /* IE8 will throw exception if display:none or not in DOM */  \r
8214                     }\r
8215                 });\r
8216             };\r
8217             scope.$watch('selCategory', function(value) {\r
8218                 if (value) {\r
8219                     scope.updateSelection(value);\r
8220                 };\r
8221             });\r
8222             ctrl.$viewChangeListeners.push(function() {\r
8223                 scope.$eval(attr.ngChange);\r
8224             });\r
8225             ctrl.$render = function() {\r
8226                 scope.selCategory = ctrl.$viewValue;\r
8227             };\r
8228             var outsideClick = function(e) {\r
8229                 var isElement = $isElement(angular.element(e.target), element, $document);\r
8230                 if (!isElement) {\r
8231                     scope.showlist = false;\r
8232                     dropdownElement.focus();\r
8233                     scope.$apply();\r
8234                 }\r
8235             };\r
8236             $documentBind.click('showlist', outsideClick, scope);\r
8237         }\r
8238     };\r
8239 }])\r
8240 .directive('textDropdown', ['$document', '$isElement', '$documentBind', "keymap", function($document, $isElement, $documentBind, keymap) {\r
8241     return {\r
8242         restrict: 'EA',\r
8243         replace: true,\r
8244         scope: {\r
8245             actions: '=actions',\r
8246             defaultAction: '=defaultAction',\r
8247             onActionClicked: '=?'\r
8248         },\r
8249         templateUrl: 'app/scripts/ng_js_att_tpls/select/textDropdown.html',\r
8250         link: function(scope, element, attr) {\r
8251             scope.selectedIndex = 0;\r
8252             scope.selectedOption = attr.placeholder;\r
8253             scope.isDisabled = false;\r
8254             scope.isActionsShown = false;\r
8255             var dropdownElement = undefined;\r
8256             if (attr.disabled) {\r
8257                 scope.isDisabled = true;\r
8258             }\r
8259 \r
8260             dropdownElement = element.find('div')[0];\r
8261 \r
8262             // Set default Action\r
8263             if (!angular.isDefined(scope.defaultAction)) {\r
8264                 scope.currentAction = scope.actions[0];\r
8265                 scope.selectedIndex = 0;\r
8266             } else if (angular.isDefined(scope.defaultAction) || scope.defaultAction !== '') {\r
8267                 for (var act in scope.actions) {\r
8268                     if (scope.actions[act] === scope.defaultAction) {\r
8269                         scope.currentAction = scope.actions[act];\r
8270                         scope.selectedIndex = scope.actions.indexOf(act);\r
8271                         scope.isActionsShown = false;\r
8272                         break;\r
8273                     }\r
8274                 }\r
8275             } else {\r
8276                 scope.currentAction = scope.actions[0];\r
8277             }\r
8278             scope.toggle = function() {\r
8279                 scope.isActionsShown = !scope.isActionsShown;\r
8280             };\r
8281             scope.chooseAction = function($event, action, $index) {\r
8282                 if ($event != null) {\r
8283                     scope.currentAction = action;\r
8284                     scope.selectedIndex = $index;\r
8285                 } else {\r
8286                     scope.currentAction = scope.actions[scope.selectedIndex];\r
8287                 }\r
8288                 if (angular.isFunction(scope.onActionClicked)) {\r
8289                     scope.onActionClicked(scope.currentAction);\r
8290                 }\r
8291                 scope.toggle();\r
8292             };\r
8293             scope.isCurrentAction = function(action) {\r
8294                 return (action === scope.currentAction);\r
8295             };\r
8296             element.bind("keydown", function(e) {\r
8297                 if (keymap.isAllowedKey(e.keyCode) || keymap.isControl(e) || keymap.isFunctionKey(e)) {\r
8298                     e.preventDefault();\r
8299                     e.stopPropagation();\r
8300                     switch (e.keyCode) {\r
8301                         case keymap.KEY.DOWN:\r
8302                             scope.selectNext();\r
8303                             break;\r
8304                         case keymap.KEY.UP:\r
8305                             scope.selectPrev();\r
8306                             break;\r
8307                         case keymap.KEY.ENTER:\r
8308                             scope.selectCurrent();\r
8309                             break;\r
8310                         case keymap.KEY.ESC:\r
8311                             scope.isActionsShown = false;\r
8312                             dropdownElement.focus();\r
8313                             scope.$apply();\r
8314                             break;\r
8315                         default:\r
8316                             break;\r
8317                     }\r
8318                     scope.$apply();\r
8319                     return;\r
8320                 } else if (e.keyCode === keymap.KEY.TAB) {\r
8321                     scope.isActionsShown = false;\r
8322                     scope.$apply();\r
8323                 }\r
8324             });\r
8325             scope.selectCurrent = function() {\r
8326                 if (scope.selectedIndex < 0) {\r
8327                     scope.selectedIndex = 0;\r
8328                 }\r
8329                 if (!scope.isActionsShown) {\r
8330                     scope.toggle();\r
8331                 } else {\r
8332                     scope.chooseAction(null, scope.currentAction);\r
8333                 }\r
8334             };\r
8335             scope.selectNext = function() {\r
8336                 if (scope.isActionsShown) {\r
8337                     if ((scope.selectedIndex + 1) < scope.actions.length) {\r
8338                         scope.selectedIndex += 1;\r
8339                     } else {\r
8340                         scope.selectedIndex = (scope.actions.length - 1);\r
8341                     }\r
8342                     scope.$apply();\r
8343                 }\r
8344             };\r
8345             scope.selectPrev = function() {\r
8346                 if (scope.isActionsShown) {\r
8347                     if ((scope.selectedIndex - 1) >= 0) {\r
8348                         scope.selectedIndex -= 1;\r
8349                     } else if (scope.selectedIndex - 1 < 0) {\r
8350                         scope.selectedIndex = 0;\r
8351                     }\r
8352                     scope.$apply();\r
8353                 }\r
8354             };\r
8355             scope.hoverIn = function(cItem) {\r
8356                 scope.selectedIndex = cItem;\r
8357             };\r
8358             //end cato\r
8359             var outsideClick = function(e) {\r
8360                 var isElement = $isElement(angular.element(e.target), element, $document);\r
8361                 if (!isElement) {\r
8362                     scope.toggle();\r
8363                     scope.$apply();\r
8364                 }\r
8365             };\r
8366             $documentBind.click('isActionsShown', outsideClick, scope);\r
8367         }\r
8368     };\r
8369 }]);\r
8370 angular.module('att.abs.slider', ['att.abs.position'])\r
8371         .constant('sliderDefaultOptions', {\r
8372             width: 300,\r
8373             step: 1,\r
8374             precision: 0,\r
8375             disabledWidth: 116\r
8376         })\r
8377         .directive('attSlider', ['sliderDefaultOptions','$position','$document', function(sliderDefaultOptions,$position,$document)\r
8378             {\r
8379                 return {\r
8380                     restrict: 'EA',\r
8381                     replace: true,\r
8382                     transclude: true,\r
8383                     scope: {\r
8384                         floor: "=",\r
8385                         ceiling: "=",\r
8386                         step: "@",\r
8387                         precision: "@",\r
8388                         width: "@",\r
8389                         textDisplay: "=",\r
8390                         value: "=",\r
8391                         ngModelSingle: '=?',\r
8392                         ngModelLow: '=?',\r
8393                         ngModelHigh: '=?',\r
8394                         ngModelDisabled: '=?'\r
8395                     },\r
8396                     templateUrl: 'app/scripts/ng_js_att_tpls/slider/slider.html',\r
8397                     link: function(scope, elem, attr)\r
8398                     {\r
8399                         var minOffset, maxOffset, newOffset, newOffset1, newOffset2, offsetRange, valueRange, start_x = 0, disabledRange, disabled, evFlag = false, minValue, maxValue, range, refLow, refHigh, maxPtr, minPtr, singlePtr, getHandles;\r
8400                         scope.minPtrOffset = 0;\r
8401                         scope.maxPtrOffset = 0;\r
8402                         var disableWidth = sliderDefaultOptions.disabledWidth;\r
8403                         //Get handles\r
8404                         var obj = elem.children();\r
8405                         disabledRange = obj[0].children;\r
8406                         disabledRange = angular.element(disabledRange[0]);\r
8407                         getHandles = obj[1].children;\r
8408                         singlePtr = angular.element(getHandles[0]);\r
8409                         minPtr = angular.element(getHandles[1]);\r
8410                         maxPtr = angular.element(getHandles[2]);\r
8411                         disabled = ((attr.ngModelSingle == null) && (attr.ngModelLow == null) && (attr.ngModelHigh == null)) && (attr.ngModelDisabled != null);\r
8412                         range = (attr.ngModelSingle == null) && ((attr.ngModelLow != null) && (attr.ngModelHigh != null));\r
8413                         refLow = 'ngModelLow';\r
8414                         refHigh = 'ngModelHigh';\r
8415                         if (!range) {\r
8416                             minPtr.remove();\r
8417                             maxPtr.remove();\r
8418                         }\r
8419                         else {\r
8420                             singlePtr.remove();\r
8421                         }\r
8422                         if (!disabled) {\r
8423                             disabledRange.remove();\r
8424                         }\r
8425                         else {\r
8426                             scope.disabledStyle = {width: disableWidth + 'px', zIndex: 1};\r
8427                             scope.handleStyle = {left: disableWidth + 'px'};\r
8428                         }\r
8429                         minValue = parseFloat(scope.floor);\r
8430                         maxValue = parseFloat(scope.ceiling);\r
8431                         valueRange = maxValue - minValue;\r
8432                         minOffset = 0;\r
8433                         if (attr.width !== undefined) {\r
8434                             maxOffset = attr.width;\r
8435                         }\r
8436                         else {\r
8437                             if (elem[0].clientWidth !== 0) {\r
8438                                 maxOffset = elem[0].clientWidth;\r
8439                             }\r
8440                             else {\r
8441                                 maxOffset = sliderDefaultOptions.width;\r
8442                             }\r
8443                         }\r
8444                         offsetRange = maxOffset - minOffset;\r
8445                         //Key Down Event\r
8446                          scope.keyDown = function(ev){\r
8447                                if(ev.keyCode === 39){\r
8448                                 var elemLeft = $position.position(elem).left;\r
8449                                 if (newOffset){\r
8450                                     if(scope.ref === "ngModelLow"){\r
8451                                         newOffset1 = sliderDefaultOptions.step + newOffset1;\r
8452                                         newOffset = newOffset1;\r
8453                                     }\r
8454                                     else if(scope.ref === "ngModelHigh"){\r
8455                                         newOffset2 = sliderDefaultOptions.step + newOffset2;\r
8456                                         newOffset = newOffset2;\r
8457                                     }\r
8458                                     else{newOffset = sliderDefaultOptions.step + newOffset;}\r
8459                                 }\r
8460                                 else {\r
8461                                     if(range &&scope.ref === "ngModelLow"){\r
8462                                         return;\r
8463                                     }\r
8464                                     else {\r
8465                                         newOffset = sliderDefaultOptions.step + elemLeft;\r
8466                                         newOffset1 = newOffset2 = newOffset;\r
8467                                     }\r
8468                                 }\r
8469                                 }\r
8470                             else if(ev.keyCode === 37){\r
8471                                 var ptrLeft = $position.position(singlePtr).left;\r
8472                                 if(newOffset){\r
8473                                 if (!(newOffset<=0)){\r
8474                                     if(scope.ref === "ngModelLow"){\r
8475                                         newOffset1 = newOffset1 - sliderDefaultOptions.step;\r
8476                                         newOffset = newOffset1;\r
8477                                     }\r
8478                                     else if(scope.ref === "ngModelHigh"){\r
8479                                         newOffset2 = newOffset2 - sliderDefaultOptions.step;\r
8480                                         newOffset = newOffset2;\r
8481                                     }\r
8482                                     else {\r
8483                                         newOffset = newOffset - sliderDefaultOptions.step;\r
8484                                         newOffset1 = newOffset2 = newOffset;\r
8485                                     }\r
8486                                 }\r
8487                                 }\r
8488                                 else {\r
8489                                     newOffset = ptrLeft - sliderDefaultOptions.step;\r
8490                                 }\r
8491                                 }\r
8492                             if(newOffset>=0){\r
8493                                 scope.ptrOffset(newOffset);\r
8494                             }\r
8495                         };\r
8496                         //Mouse Down Event                         \r
8497                         scope.mouseDown = function(e, ref) {\r
8498                             scope.ref = ref;\r
8499                             evFlag = true;\r
8500                             if (!range){\r
8501                                 if (newOffset)\r
8502                                 {\r
8503                                     start_x = e.clientX - newOffset;\r
8504                                 }\r
8505                                 else {\r
8506                                     start_x = e.clientX;\r
8507                                 }\r
8508                             } else {\r
8509                                 if (scope.ref === refLow) {\r
8510                                     start_x = e.clientX - scope.minPtrOffset;\r
8511                                 }\r
8512                                 else {\r
8513                                     start_x = e.clientX - scope.maxPtrOffset;\r
8514                                 }\r
8515                             }\r
8516                             if (disabled) {\r
8517                                 scope.ref= 'ngModelDisabled';\r
8518                                 scope.disabledStyle = {width: disableWidth + 'px', zIndex: 1};\r
8519                             }\r
8520                         };\r
8521                         // Mouse Move Event\r
8522                         scope.moveElem = function(ev) {\r
8523                             if (evFlag) {\r
8524                                 var eventX;\r
8525                                 eventX = ev.clientX;\r
8526                                 newOffset = eventX - start_x;\r
8527                                 scope.ptrOffset(newOffset);\r
8528                             }\r
8529                         };\r
8530                         scope.focus=function(ev,ref){\r
8531                             console.log(ref);\r
8532                             scope.ref=ref;\r
8533                         }\r
8534                         // Mouse Up Event\r
8535                         scope.mouseUp = function(ev) {\r
8536                             evFlag = false;\r
8537                             minPtr.removeClass('dragging');\r
8538                             maxPtr.removeClass('dragging');\r
8539                             singlePtr.removeClass('dragging');\r
8540                             $document.off('mousemove');\r
8541                         };\r
8542                         // key Up Event\r
8543                         scope.keyUp = function(ev) {\r
8544                             evFlag = false;\r
8545                             minPtr.removeClass('dragging');\r
8546                             maxPtr.removeClass('dragging');\r
8547                             singlePtr.removeClass('dragging');\r
8548                             $document.off('mousemove');\r
8549                         };\r
8550                         //Function to calculate the current PositionValue\r
8551                         scope.calStep = function(value, precision, step, floor) {\r
8552                             var decimals, remainder, roundedValue, steppedValue;\r
8553                             if (floor === null) {\r
8554                                 floor = 0;\r
8555                             }\r
8556                             if (step === null) {\r
8557                                 step = 1 / Math.pow(10, precision);\r
8558                             }\r
8559                             remainder = (value - floor) % step;\r
8560                             steppedValue = remainder > (step / 2) ? value + step - remainder : value - remainder;\r
8561                             decimals = Math.pow(10, precision);\r
8562                             roundedValue = steppedValue * decimals / decimals;\r
8563                             return roundedValue.toFixed(precision);\r
8564                         };\r
8565                         //Function to calculate Offset Percent\r
8566                         scope.percentOffset = function(offset) {\r
8567                             return ((offset - minOffset) / offsetRange) * 100;\r
8568                         };\r
8569                         //Function to calculate Offset position\r
8570                         scope.ptrOffset = function(newOffset){\r
8571                             var newPercent, newValue;\r
8572                                 newOffset = Math.max(Math.min(newOffset, maxOffset), minOffset);\r
8573                                 newPercent = scope.percentOffset(newOffset);\r
8574                                 newValue = minValue + (valueRange * newPercent / 100.0);\r
8575                                 if (range) {\r
8576                                     var rangeSliderWidth;\r
8577                                     if (scope.ref === refLow) {\r
8578                                         scope.minHandleStyle = {left: newOffset + "px"};\r
8579                                         scope.minNewVal = newValue;\r
8580                                         scope.minPtrOffset = newOffset;\r
8581                                         minPtr.addClass('dragging');\r
8582                                         if (newValue > scope.maxNewVal) {\r
8583                                             scope.ref = refHigh;\r
8584                                             maxPtr[0].focus();\r
8585                                             scope.maxNewVal = newValue;\r
8586                                             scope.maxPtrOffset = newOffset;\r
8587                                             maxPtr.addClass('dragging');\r
8588                                             minPtr.removeClass('dragging');\r
8589                                             scope.maxHandleStyle = {left: newOffset + "px"};\r
8590                                         }\r
8591                                     }\r
8592                                     else {\r
8593                                         scope.maxHandleStyle = {left: newOffset + "px"};\r
8594                                         scope.maxNewVal = newValue;\r
8595                                         scope.maxPtrOffset = newOffset;\r
8596                                         maxPtr.addClass('dragging');\r
8597                                         if (newValue < scope.minNewVal) {\r
8598                                             scope.ref = refLow;\r
8599                                             minPtr[0].focus();\r
8600                                             scope.minVal = newValue;\r
8601                                             scope.minPtrOffset = newOffset;\r
8602                                             minPtr.addClass('dragging');\r
8603                                             maxPtr.removeClass('dragging');\r
8604                                             scope.minHandleStyle = {left: newOffset + "px"};\r
8605                                         }\r
8606                                     }\r
8607                                     rangeSliderWidth = parseInt(scope.maxPtrOffset) - parseInt(scope.minPtrOffset);\r
8608                                     scope.rangeStyle = {width: rangeSliderWidth + "px", left: scope.minPtrOffset + "px"};\r
8609                                 }\r
8610                                 else {\r
8611                                     if (disabled && newOffset > disableWidth) {\r
8612                                         scope.rangeStyle = {width: newOffset + "px", zIndex: 0};\r
8613                                     }\r
8614                                     else {\r
8615                                         singlePtr.addClass('dragging');\r
8616                                         scope.rangeStyle = {width: newOffset + "px"};\r
8617                                     }\r
8618                                     scope.handleStyle = {left: newOffset + "px"};\r
8619                                 }\r
8620                                 if ((scope.precision === undefined) || (scope.step === undefined)) {\r
8621                                     scope.precision = sliderDefaultOptions.precision;\r
8622                                     scope.step = sliderDefaultOptions.step;\r
8623                                 }\r
8624                                 newValue = scope.calStep(newValue, parseInt(scope.precision), parseFloat(scope.step), parseFloat(scope.floor));\r
8625                                 scope[scope.ref] = newValue;\r
8626                         };\r
8627                     }\r
8628                 };\r
8629             }\r
8630         ]).directive('attSliderMin',[function()\r
8631             {\r
8632              return{\r
8633                  require: '^attSlider',\r
8634                  restrict: 'EA',\r
8635                  replace: true,\r
8636                  transclude: true,\r
8637                  templateUrl: 'app/scripts/ng_js_att_tpls/slider/minContent.html'\r
8638                };\r
8639          }\r
8640     ]).directive('attSliderMax',[function()\r
8641             {\r
8642              return{\r
8643                  require: '^attSlider',\r
8644                  restrict: 'EA',\r
8645                  replace: true,\r
8646                  transclude: true,\r
8647                  templateUrl: 'app/scripts/ng_js_att_tpls/slider/maxContent.html'\r
8648              };\r
8649          }\r
8650     ]);\r
8651 angular.module('att.abs.splitButtonDropdown', ['att.abs.utilities','att.abs.position'])\r
8652     .directive('attButtonDropdown', ['$document', '$parse', '$documentBind', '$timeout','$isElement', function ($document, $parse, $documentBind, $timeout,$isElement) {\r
8653         return {\r
8654             restrict: 'EA',\r
8655             replace: true,\r
8656             transclude: true,            \r
8657             templateUrl: 'app/scripts/ng_js_att_tpls/splitButtonDropdown/splitButtonDropdown.html',\r
8658             scope: {\r
8659                 btnText: "@",\r
8660                 btnType: "@",\r
8661                 btnLink: "@",\r
8662                 btnClick: "&",\r
8663                 toggleTitle:"@",                \r
8664             },\r
8665             controller: ['$scope', '$element', function ($scope, $element) {\r
8666                     \r
8667                 this.cSelected = 0;    \r
8668                 this.closeAndFocusDropdown = function () {\r
8669                     if ($scope.isDropDownOpen) {\r
8670                         $scope.$apply(function () {\r
8671                         $scope.isDropDownOpen = false;\r
8672                         angular.element($element[0].querySelector('a.dropdown-toggle'))[0].focus();                        \r
8673                         });\r
8674                     }\r
8675                 };             \r
8676                 \r
8677                 this.focusNext = function () {                                            \r
8678                     this.cSelected = this.cSelected + 1 >= this.childScopes.length ?($scope.cycleSelection === true ? 0 : this.childScopes.length-1): this.cSelected +1;\r
8679                     this.childScopes[this.cSelected].sFlag = true;                    \r
8680                     this.resetFlag(this.cSelected);                    \r
8681                 }; \r
8682                 \r
8683                 this.focusPrev = function () {                        \r
8684                     this.cSelected = this.cSelected -1 < 0 ? ($scope.cycleSelection === true ? this.childScopes.length-1 : 0) : this.cSelected - 1 ;\r
8685                     this.childScopes[this.cSelected].sFlag = true;                    \r
8686                     this.resetFlag(this.cSelected);                    \r
8687                 };                 \r
8688                                                 \r
8689                 this.childScopes = [];\r
8690                 this.registerScope = function(childScope)\r
8691                 {\r
8692                     this.childScopes.push(childScope);                    \r
8693                 };\r
8694                 \r
8695                 this.resetFlag = function(index){                                        \r
8696                     for(var i=0; i < this.childScopes.length; i++) \r
8697                     {\r
8698                         if(i !== index)\r
8699                         {\r
8700                             this.childScopes[i].sFlag = false;\r
8701                         }\r
8702                     }\r
8703                 };\r
8704                 \r
8705             }],\r
8706             link: function (scope, element, attr) {                \r
8707                 scope.isSmall = attr.small === "" ? true : false;\r
8708                 scope.multiselect = attr.multiselect === ""? true : false;\r
8709                 scope.cycleSelection = attr.cycleSelection === "" ? true : false;\r
8710                 scope.isDropDownOpen = false;\r
8711                 scope.isActionDropdown = false;\r
8712                \r
8713                 if (!(scope.btnText)) {\r
8714                     scope.isActionDropdown = true;\r
8715                 }\r
8716 \r
8717                 scope.clickFxn = function () {\r
8718                     if (typeof scope.btnClick === "function" && !scope.btnLink) {\r
8719                         scope.btnClick = $parse(scope.btnClick);\r
8720                         scope.btnClick();\r
8721                     }                    \r
8722                     if(scope.multiselect === true)\r
8723                     {\r
8724                         scope.isDropDownOpen = false;\r
8725                     }\r
8726                 };\r
8727 \r
8728                 scope.toggleDropdown = function () {\r
8729                     if (!(scope.btnType === 'disabled')) {\r
8730                         scope.isDropDownOpen = !scope.isDropDownOpen;\r
8731                         if (scope.isDropDownOpen) {\r
8732                             $timeout(function () {\r
8733                                 angular.element(element[0].querySelector('li'))[0].focus();\r
8734                             });\r
8735                         }\r
8736                     }\r
8737                 };\r
8738 \r
8739                 scope.btnTypeSelector = function (directiveValue, attrValue) {\r
8740                     if (directiveValue !== "") {\r
8741                         scope.btnTypeFinal = directiveValue;\r
8742                     } else {\r
8743                         scope.btnTypeFinal = attrValue;\r
8744                     }\r
8745                 };\r
8746 \r
8747                 var outsideClick = function(e) {\r
8748                     var isElement = $isElement(angular.element(e.target), element.find('ul').eq(0), $document);\r
8749                     if (!isElement) {\r
8750                         scope.isDropDownOpen = false;\r
8751                         scope.$apply();\r
8752                     }\r
8753                 };\r
8754 \r
8755                 $documentBind.click('isDropDownOpen', outsideClick, scope);\r
8756 \r
8757                 attr.$observe('btnType', function (val) {\r
8758                     scope.btnType = val;\r
8759                 });\r
8760                 attr.$observe('attButtonDropdown', function (val) {\r
8761                     attr.attButtonDropdown = val;\r
8762                     scope.btnTypeSelector(attr.attButtonDropdown, scope.btnType);\r
8763                 });\r
8764             }\r
8765         };\r
8766 \r
8767             }])\r
8768        \r
8769 .directive('attButtonDropdownItem', ['$location','keymap', function ($location,keymap) {\r
8770         return {\r
8771             restrict: 'EA',\r
8772             require: ['^attButtonDropdown','?ngModel'],\r
8773             replace: true,\r
8774             transclude: true,            \r
8775             templateUrl:'app/scripts/ng_js_att_tpls/splitButtonDropdown/splitButtonDropdownItem.html',                                                 scope: {\r
8776                 itemLink: "@"\r
8777             },\r
8778             link: function (scope, element, attr, ctrl) {\r
8779                 var rootLink = angular.element(element[0].querySelector('a'));\r
8780                 scope.sFlag = false;\r
8781                 ctrl[0].registerScope(scope);\r
8782                 var clickOnLink = function () {\r
8783                     if (scope.itemLinkFinal) {\r
8784                         $location.url(scope.itemLinkFinal);\r
8785                     }\r
8786                 };\r
8787                 \r
8788                 if(ctrl[1]){\r
8789                     scope.isSelected = ctrl[1].$viewValue;\r
8790                 }else{\r
8791                     scope.isSelected = false;\r
8792                 }                \r
8793                 \r
8794                 element.bind('keydown', function(e) {\r
8795                 if (keymap.isAllowedKey(e.keyCode) || keymap.isControl(e) || keymap.isFunctionKey(e)) {\r
8796                     e.preventDefault();\r
8797                     e.stopPropagation();\r
8798                     switch (e.keyCode) {\r
8799                         case keymap.KEY.DOWN: \r
8800                             ctrl[0].focusNext();                             \r
8801                             break;\r
8802                         case keymap.KEY.UP:                            \r
8803                             ctrl[0].focusPrev();\r
8804                             break;\r
8805                         case keymap.KEY.ENTER:                                                        \r
8806                             scope.selectItem();\r
8807                             break;\r
8808                         case keymap.KEY.ESC:\r
8809                             ctrl[0].closeAndFocusDropdown();\r
8810                             break;\r
8811                         default:\r
8812                             break;\r
8813                     }\r
8814                     \r
8815                 }\r
8816                     scope.$apply();\r
8817                 }); \r
8818                                  \r
8819                 scope.selectItem = function()\r
8820                 {\r
8821                     if(ctrl[1]){\r
8822                         scope.$evalAsync(function(){ctrl[1].$setViewValue(!ctrl[1].$viewValue)});\r
8823                     }\r
8824                 }; \r
8825 \r
8826             }\r
8827         };\r
8828     }]);\r
8829 \r
8830 angular.module('att.abs.splitIconButton', ['att.abs.utilities'])\r
8831 .constant('iconStateConstants', {\r
8832     MIDDLE: 'middle',\r
8833     LEFT: 'left',\r
8834     RIGHT: 'right',\r
8835     NEXT_TO_DROPDOWN:'next-to-dropdown',\r
8836     LEFT_NEXT_TO_DROPDOWN:'left-next-to-dropdown',\r
8837     DIR_TYPE: {\r
8838         LEFT: 'left',\r
8839         RIGHT:  'right',\r
8840         BUTTON: 'button'\r
8841     },\r
8842     SPLIT_ICON_BTN_EVENT_EMITTER_KEY: 'splitIconButtonTap'\r
8843 })\r
8844 .directive('expandableLine', [function(){\r
8845     return {\r
8846         restrict: 'EA',\r
8847         replace: true,\r
8848         priority: 300,\r
8849         require: ['^attSplitIconButton', 'expandableLine'],\r
8850         controller: ['$scope', function($scope){\r
8851             $scope.isActive = false;\r
8852             this.setActiveState = function(isActive){\r
8853                 $scope.isActive = isActive;\r
8854             };\r
8855             this.isActive = $scope.isActive;\r
8856             this.dirType = $scope.dirType;\r
8857         }],\r
8858         template: '<div ng-class="{\'expand-line-container\': !isActive, \'expand-line-container-active\': isActive}"> <div ng-class="{\'hovered-line\':isActive, \'vertical-line\':!isActive}"> </div></div>',\r
8859         scope:{\r
8860             dirType: '@'\r
8861         },\r
8862         link: function(scope,element,attr,ctrls) {\r
8863             var attSplitIconButtonCtrl = ctrls[0];\r
8864             var expandableLineCtrl = ctrls[1];\r
8865             attSplitIconButtonCtrl.addSubCtrl(expandableLineCtrl);\r
8866         }\r
8867     };\r
8868 }])\r
8869 .controller('AttSplitIconCtrl', ['$scope', function($scope){\r
8870     this.setType = function(type){\r
8871         $scope.type = type;\r
8872     };  \r
8873     this.isDropdown = function(isDropdown){\r
8874          $scope.isDropdown = isDropdown;\r
8875     };\r
8876     this.dropDownClicked = function(){\r
8877         if($scope.dropDownClicked) {\r
8878             $scope.dropDownClicked();\r
8879         }\r
8880     };\r
8881     this.dirType = $scope.dirType;\r
8882 }])\r
8883 .directive('attSplitIcon', ['$document', '$timeout','iconStateConstants','$documentBind','events', 'keymap',\r
8884  function($document,$timeout,iconStateConstants,$documentBind, events, keymap){\r
8885     return {\r
8886         restrict: 'EA',\r
8887         replace: true,\r
8888         priority: 200,\r
8889         transclude: true,\r
8890         require: ['^attSplitIconButton','attSplitIcon'],\r
8891         templateUrl: 'app/scripts/ng_js_att_tpls/splitIconButton/splitIcon.html',\r
8892         scope:{\r
8893             icon: '@',\r
8894             iconTitle: '@title',\r
8895             hoverWatch: '=',\r
8896             dropDownWatch: '=',\r
8897             dirType: '@'\r
8898         },\r
8899         controller:'AttSplitIconCtrl',\r
8900         link: function(scope,element,attr,ctrls){\r
8901             var attSplitIconButtonCtrl = ctrls[0];\r
8902             var attSplitIconCtrl = ctrls[1];\r
8903             attSplitIconButtonCtrl.addSubCtrl(attSplitIconCtrl);\r
8904             scope.iconStateConstants = iconStateConstants;\r
8905             var currentIndex = 0;\r
8906             var isMyElement = false;\r
8907             var listElements;\r
8908             scope.isDropdown = false;\r
8909             scope.isDropdownOpen = false;\r
8910             var outsideClick = function(e) {\r
8911                 if(scope.isDropdown){\r
8912                     if (isMyElement) {\r
8913                         isMyElement = false;\r
8914                         scope.toggleDropdown();\r
8915                     } else{\r
8916                         scope.toggleDropdown(false);\r
8917                     }\r
8918                     scope.$apply();\r
8919                 }\r
8920             };\r
8921             if(attr.dropDownId && attr.dropDownId !== ''){\r
8922                 scope.dropDownId = attr.dropDownId;\r
8923                 scope.isDropdown = true;\r
8924             }\r
8925             scope.$on(iconStateConstants.SPLIT_ICON_BTN_EVENT_EMITTER_KEY, function(evnt, data){\r
8926                 if(typeof data === 'boolean' && data) {\r
8927                     scope.dropDownClicked();     \r
8928                     /*\r
8929                         Check if the dropdown is open and if we are selecting one\r
8930                         of the items, so that when pressing enter it will trigger it.\r
8931                     */\r
8932                     if(scope.isDropDownOpen) {\r
8933                         listElements[currentIndex].eq(0).find('a')[0].click();\r
8934                     }\r
8935                 } else {\r
8936                     var e = data;\r
8937                     //Only trigger the keyboard event if the icon button is a dropdown type\r
8938                     if(scope.isDropdown) {\r
8939                         triggerKeyboardEvents(e);   \r
8940                     }\r
8941                 }\r
8942                 function triggerKeyboardEvents(e) {\r
8943                     switch(e.which) {\r
8944                         case (keymap.KEY.TAB):\r
8945                             scope.toggleDropdown(false);\r
8946                             scope.$digest();\r
8947                             break;\r
8948                         case (keymap.KEY.ESC): \r
8949                             outsideClick();\r
8950                             break;\r
8951                         case (keymap.KEY.ENTER):\r
8952                             if (scope.isDropDownOpen) {\r
8953                                 listElementsInit();\r
8954                             }\r
8955                             break;\r
8956                         case (keymap.KEY.UP):\r
8957                             e.preventDefault();\r
8958                             events.stopPropagation(e);\r
8959                             if(scope.isDropDownOpen) {\r
8960                                 scope.previousItemInDropdown();\r
8961                             }\r
8962                             break;\r
8963                         case (keymap.KEY.DOWN):\r
8964                             e.preventDefault();\r
8965                             events.stopPropagation(e);\r
8966                             //Dropdown is open and the user taps down again\r
8967                             if(scope.isDropDownOpen) {\r
8968                                 //Now we need to go through the rows in the dropdown\r
8969                                 scope.nextItemInDropdown();\r
8970                             } else {\r
8971                                 isMyElement = true;\r
8972                                 outsideClick();\r
8973                                 listElementsInit();\r
8974                             }\r
8975                             break;\r
8976                         default:\r
8977                             break;\r
8978                     }\r
8979                 }\r
8980                 function listElementsInit() {\r
8981                     if(listElements === undefined) {\r
8982                         listElements = [];\r
8983                         var liTemps = element.find('li');\r
8984                         for(var i = 0; i < liTemps.length; i++) {\r
8985                             listElements.push(liTemps.eq(i));\r
8986                         }\r
8987                         listElements[currentIndex].children().eq(0).addClass('selected-item');\r
8988                     }\r
8989                 }\r
8990             });\r
8991             scope.nextItemInDropdown = function(){\r
8992                 if(listElements && currentIndex < listElements.length - 1){\r
8993                     currentIndex++;\r
8994                     listElements[currentIndex - 1].children().eq(0).removeClass('selected-item');\r
8995                     listElements[currentIndex].children().eq(0).addClass('selected-item');\r
8996                 }\r
8997             };\r
8998             scope.previousItemInDropdown = function(){\r
8999                 if(currentIndex > 0) {\r
9000                     currentIndex--;\r
9001                     listElements[currentIndex].children().eq(0).addClass('selected-item');\r
9002 \r
9003                     if(currentIndex + 1 < listElements.length)\r
9004                         listElements[currentIndex + 1].children().eq(0).removeClass('selected-item');\r
9005                 }\r
9006             };\r
9007             scope.$watch('isIconHovered', function(val) {\r
9008                 scope.hoverWatch = val;\r
9009             });\r
9010             scope.$watch('type', function(val) {\r
9011                 function toggleValues(isMiddle,isNextToDropDown,isRight,isLeft,isLeftNextDropdown){\r
9012                     scope['isMiddle']  = isMiddle;\r
9013                     scope['isNextToDropDown'] = isNextToDropDown;\r
9014                     scope['isRight']  = isRight;\r
9015                     scope['isLeft'] = isLeft;\r
9016                     scope['isLeftNextDropdown'] = isLeftNextDropdown;\r
9017                 };\r
9018                 switch(val) {\r
9019                     case (scope.iconStateConstants.MIDDLE):\r
9020                         toggleValues(true,false,false,true,false);\r
9021                         break;\r
9022                     case (scope.iconStateConstants.LEFT):\r
9023                         toggleValues(false,false,false,true,false);\r
9024                         break;\r
9025                     case (scope.iconStateConstants.RIGHT):\r
9026                         toggleValues(false,false,true,false,false);\r
9027                         break;\r
9028                     case (scope.iconStateConstants.NEXT_TO_DROPDOWN):\r
9029                         toggleValues(false,true,true,true,false);\r
9030                         break;\r
9031                     case (scope.iconStateConstants.LEFT_NEXT_TO_DROPDOWN):\r
9032                         toggleValues(false,false,false,true,true);\r
9033                         break;\r
9034                     default:\r
9035                         break;\r
9036                 }\r
9037             });\r
9038             scope.dropDownClicked = function() {\r
9039                 isMyElement = true;\r
9040             };\r
9041             scope.toggleDropdown = function(val) {\r
9042                 if(val !== undefined) {\r
9043                     scope.isDropDownOpen = val;\r
9044                 } else {\r
9045                     scope.isDropDownOpen = !scope.isDropDownOpen; \r
9046                 }\r
9047                 scope.dropDownWatch = scope.isDropDownOpen;\r
9048             };\r
9049             $documentBind.click('isDropdown', outsideClick, scope);\r
9050         }\r
9051     };\r
9052 }])\r
9053 .controller('AttSplitIconButtonCtrl',['$scope', 'iconStateConstants',function($scope,iconStateConstants){\r
9054     this.subCtrls = [];\r
9055     $scope.isLeftLineShown=true;\r
9056     $scope.isRightLineShown=true;\r
9057     $scope.childrenScopes = [];\r
9058     var that = this;\r
9059 \r
9060     function getDirIndex(dirType) {\r
9061         var index = -1;\r
9062         for(var c in that.subCtrls) {\r
9063             var ctrl = that.subCtrls[c];\r
9064             if(ctrl.dirType === dirType) {\r
9065                 index = c;\r
9066                 break;\r
9067             }\r
9068         }\r
9069         return index;\r
9070     }\r
9071     this.addSubCtrl =  function(sub) {\r
9072         this.subCtrls.push(sub);\r
9073     };\r
9074     this.isLeftLineShown = function(isShown) {\r
9075         if(isShown === undefined) {\r
9076             return $scope.isLeftLineShown;\r
9077         } else {\r
9078             $scope.isLeftLineShown = isShown;\r
9079         }\r
9080     };\r
9081     this.isRightLineShown = function(isShown) {\r
9082         if(isShown === undefined) {\r
9083             return $scope.isRightLineShown;\r
9084         } else {\r
9085             $scope.isRightLineShown = isShown;\r
9086         }\r
9087     };\r
9088     this.setLeftLineHover = function(isHovered) {\r
9089         var leftLineIndex = getDirIndex(iconStateConstants.DIR_TYPE.LEFT);\r
9090 \r
9091         if($scope.isLeftLineShown && this.subCtrls[leftLineIndex] && this.subCtrls[leftLineIndex].setActiveState) {\r
9092             this.subCtrls[leftLineIndex].setActiveState(isHovered);\r
9093         }\r
9094     };\r
9095     this.setRightLineHover = function(isHovered) {\r
9096         var rightLineIndex = getDirIndex(iconStateConstants.DIR_TYPE.RIGHT);\r
9097         if($scope.isRightLineShown && this.subCtrls[rightLineIndex] && this.subCtrls[rightLineIndex].setActiveState){\r
9098             this.subCtrls[rightLineIndex].setActiveState(isHovered);\r
9099         }\r
9100     };\r
9101     this.toggleLines = function(isHovered, buttonGroupCtrl, buttonCtrl, isDropDownOpen) {  \r
9102         var subIconButtons = buttonGroupCtrl.subIconButtons;\r
9103         var subIconButtonsLength = subIconButtons.length;\r
9104         var leftLineIndex =  getDirIndex(iconStateConstants.DIR_TYPE.LEFT);\r
9105         var rightLineIndex =  getDirIndex(iconStateConstants.DIR_TYPE.RIGHT);\r
9106         function noVerticalLineToggle() {\r
9107             for(var i =0; i < subIconButtonsLength; i++) {\r
9108                 if(subIconButtons[i] === buttonCtrl) {\r
9109                     if(i + 1 <= subIconButtonsLength - 1 && subIconButtons[i+1].isLeftLineShown() \r
9110                             && subIconButtons[i+1].subCtrls[leftLineIndex] \r
9111                             && subIconButtons[i+1].subCtrls[leftLineIndex].setActiveState) {\r
9112                         subIconButtons[i+1].subCtrls[leftLineIndex].setActiveState(isHovered);\r
9113                     }\r
9114                     if(i - 1 >= 0 && subIconButtons[i-1].isRightLineShown() \r
9115                             && subIconButtons[i-1].subCtrls[rightLineIndex] \r
9116                             && subIconButtons[i-1].subCtrls[rightLineIndex].setActiveState) {\r
9117                         subIconButtons[i-1].subCtrls[rightLineIndex].setActiveState(isHovered);\r
9118                     }\r
9119                     break;\r
9120                 }\r
9121             }\r
9122         }   \r
9123         if(isDropDownOpen) {\r
9124             /*\r
9125               If the button is next to the dropdown button then just keep the \r
9126               buttons left line or its left neighbors right line toggled on\r
9127               If the button is the dropdown button don't do anything\r
9128               else do things normally witht the button\r
9129             */\r
9130             /*if(subIconButtons[subIconButtonsLength-1] === buttonCtrl) {\r
9131 \r
9132             }\r
9133             else */\r
9134             if(subIconButtons[subIconButtonsLength-2]==buttonCtrl) {\r
9135                 if(subIconButtons[subIconButtonsLength-2].isLeftLineShown()) {\r
9136                     subIconButtons[subIconButtonsLength-2].subCtrls[leftLineIndex].setActiveState(isHovered);\r
9137                 } else if(subIconButtonsLength  - 3 >= 0) {\r
9138                     if(subIconButtons[subIconButtonsLength-3].isRightLineShown()) {\r
9139                         subIconButtons[subIconButtonsLength-3].subCtrls[rightLineIndex].setActiveState(isHovered);\r
9140                     }\r
9141                 }\r
9142             } else {\r
9143                 noVerticalLineToggle();\r
9144 \r
9145                 if($scope.isLeftLineShown) {\r
9146                     this.subCtrls[leftLineIndex].setActiveState(isHovered);\r
9147                 }\r
9148                 if($scope.isRightLineShown) {\r
9149                     this.subCtrls[rightLineIndex].setActiveState(isHovered);\r
9150                 }\r
9151             }\r
9152         } else { // End of if(isDropDownOpen)\r
9153             //Handle Special cases where they aren't showing any vertical lines\r
9154             //and the dropdown isn't down\r
9155             if(!$scope.isLeftLineShown && !$scope.isRightLineShown) {\r
9156                 noVerticalLineToggle();\r
9157             }   \r
9158             if($scope.isLeftLineShown && this.subCtrls[leftLineIndex].setActiveState) {\r
9159                 this.subCtrls[leftLineIndex].setActiveState(isHovered);\r
9160             }\r
9161             if($scope.isRightLineShown && this.subCtrls[rightLineIndex].setActiveState){\r
9162                 this.subCtrls[rightLineIndex].setActiveState(isHovered);\r
9163             }\r
9164         }\r
9165     };\r
9166     this.setButtonType = function(type){\r
9167         var buttonIndex = getDirIndex(iconStateConstants.DIR_TYPE.BUTTON);\r
9168         if(this.subCtrls[buttonIndex] && this.subCtrls[buttonIndex].setType) {\r
9169             this.subCtrls[buttonIndex].setType(type);\r
9170         }\r
9171     };\r
9172 }])\r
9173 .directive('attSplitIconButton', ['$document', 'iconStateConstants', 'keymap',\r
9174     function($document, iconStateConstants, keymap){\r
9175     return {\r
9176         restrict: 'EA',\r
9177         replace: true,\r
9178         priority: 100,\r
9179         transclude: true,\r
9180         require: ['^attSplitIconButtonGroup', 'attSplitIconButton'],\r
9181         controller: 'AttSplitIconButtonCtrl',\r
9182         templateUrl: 'app/scripts/ng_js_att_tpls/splitIconButton/splitIconButton.html',\r
9183         scope:{\r
9184             icon: '@',\r
9185             title: '@',\r
9186             dropDownId: '@'\r
9187         },\r
9188         link: function(scope,element,attr,ctrls) {\r
9189             if(!scope.title) {\r
9190                 scope.title = scope.icon;\r
9191             }\r
9192             var attSplitButtonGroupCtrl = ctrls[0];\r
9193             var attSplitIconButtonCtrl = ctrls[1];\r
9194             attSplitButtonGroupCtrl.addIconButton(attSplitIconButtonCtrl);\r
9195             element.bind('keydown', function(e){\r
9196                 //Check if the key is the up or down key\r
9197                 if(e.which === keymap.KEY.ESC ||\r
9198                     e.which === keymap.KEY.DOWN ||\r
9199                     e.which === keymap.KEY.ENTER ||\r
9200                     e.which === keymap.KEY.UP ||\r
9201                     e.which === keymap.KEY.TAB ) {\r
9202                     scope.clickHandler();\r
9203                     scope.$broadcast(iconStateConstants.SPLIT_ICON_BTN_EVENT_EMITTER_KEY, e);\r
9204                 }\r
9205             });\r
9206             scope.dropDownWatch = false;\r
9207             scope.iconStateConstants = iconStateConstants;\r
9208             scope.clickHandler = function() {\r
9209                 attSplitButtonGroupCtrl.hideLeftLineRightButton(attSplitIconButtonCtrl);\r
9210             };\r
9211             scope.$watch('isHovered', function(val){\r
9212                 if(val) {\r
9213                     attSplitIconButtonCtrl.toggleLines(val,attSplitButtonGroupCtrl,attSplitIconButtonCtrl,attSplitButtonGroupCtrl.isDropDownOpen);\r
9214                 } else{\r
9215                     attSplitIconButtonCtrl.toggleLines(val,attSplitButtonGroupCtrl,attSplitIconButtonCtrl,attSplitButtonGroupCtrl.isDropDownOpen);\r
9216                 }\r
9217             });\r
9218             scope.$watch('dropDownWatch', function(val) {\r
9219                 attSplitButtonGroupCtrl.isDropDownOpen = val;\r
9220                 attSplitButtonGroupCtrl.toggleDropdownState(val);\r
9221             });\r
9222         }\r
9223     }\r
9224 }])\r
9225 .controller('AttSplitIconButtonGroupCtrl',   ['$scope','iconStateConstants',function($scope,iconStateConstants){\r
9226     this.subIconButtons = [];\r
9227     this.addIconButton = function(iconButton){\r
9228        this.subIconButtons.push(iconButton);\r
9229     };\r
9230     this.isDropDownOpen = false;\r
9231     this.hideLeftLineRightButton = function(btn){\r
9232         var numButtons = this.subIconButtons.length;\r
9233         var buttonLeftOfRightMost = this.subIconButtons[numButtons - 2];\r
9234         var rightMostButton = this.subIconButtons[numButtons -1];\r
9235 \r
9236         if (btn != buttonLeftOfRightMost && btn != rightMostButton ){\r
9237             rightMostButton.setLeftLineHover(false);\r
9238         }\r
9239     };\r
9240     this.toggleDropdownState = function(isDropDownOpen){\r
9241         var numButtons = this.subIconButtons.length;\r
9242         if(numButtons > 2) {\r
9243             if(isDropDownOpen) {\r
9244                 if(this.subIconButtons[numButtons - 2].isRightLineShown()) {\r
9245                     this.subIconButtons[numButtons - 2].setRightLineHover(true);\r
9246                 } else {\r
9247                     this.subIconButtons[numButtons - 1].setLeftLineHover(true);\r
9248                 }\r
9249                 this.subIconButtons[numButtons - 2].setButtonType(iconStateConstants.NEXT_TO_DROPDOWN);\r
9250             } else {\r
9251                 this.subIconButtons[numButtons - 1].setLeftLineHover(false);\r
9252                 this.subIconButtons[numButtons - 2].setButtonType(iconStateConstants.MIDDLE);\r
9253             }\r
9254         } else {\r
9255             if(isDropDownOpen) {\r
9256                 this.subIconButtons[0].setRightLineHover(true);\r
9257                 this.subIconButtons[0].setButtonType(iconStateConstants.LEFT_NEXT_TO_DROPDOWN);\r
9258             } else {\r
9259                 this.subIconButtons[0].setButtonType(iconStateConstants.LEFT);\r
9260             }\r
9261         }\r
9262     };\r
9263 }])\r
9264 .directive('attSplitIconButtonGroup', ['$document', '$timeout',  'iconStateConstants' ,function($document,$timeout,iconStateConstants){\r
9265     return {\r
9266         restrict: 'EA',\r
9267         replace: true,\r
9268         priority: 50,\r
9269         transclude: true,\r
9270         require: 'attSplitIconButtonGroup',\r
9271         controller: 'AttSplitIconButtonGroupCtrl',\r
9272         templateUrl: 'app/scripts/ng_js_att_tpls/splitIconButton/splitIconButtonGroup.html',\r
9273         scope:{},\r
9274         link: function(scope,element,attr,ctrls){\r
9275             $timeout(initialize,100);\r
9276             function initialize(){\r
9277                 var subIconButtonCtrls = ctrls.subIconButtons;\r
9278                 var leftMostButtonIndex = 0;\r
9279                 var rightMostButtonIndex =subIconButtonCtrls.length-1;\r
9280                 //left most button config\r
9281                 subIconButtonCtrls[leftMostButtonIndex].setButtonType(iconStateConstants.LEFT);\r
9282                 subIconButtonCtrls[leftMostButtonIndex].isLeftLineShown(false);\r
9283                 subIconButtonCtrls[leftMostButtonIndex].isRightLineShown(true);\r
9284                 //right most button config\r
9285                 subIconButtonCtrls[rightMostButtonIndex].setButtonType(iconStateConstants.RIGHT);\r
9286                 subIconButtonCtrls[rightMostButtonIndex].isRightLineShown(false);\r
9287                 subIconButtonCtrls[rightMostButtonIndex].isLeftLineShown(false);\r
9288                 //middle buttons config\r
9289                 if(rightMostButtonIndex >= 2) {\r
9290                     var index = 1;\r
9291                     while(index < rightMostButtonIndex) {\r
9292                         subIconButtonCtrls[index].setButtonType(iconStateConstants.MIDDLE);\r
9293                         subIconButtonCtrls[index].isRightLineShown(false);\r
9294                         subIconButtonCtrls[index].isLeftLineShown(false);\r
9295                         index++;\r
9296                     }\r
9297                     var skipIndex = 2;\r
9298                     while(skipIndex <= rightMostButtonIndex){\r
9299                         if(skipIndex == rightMostButtonIndex) {\r
9300                             subIconButtonCtrls[skipIndex].isLeftLineShown(true);\r
9301                         } else {\r
9302                             subIconButtonCtrls[skipIndex].isRightLineShown(true);\r
9303                             subIconButtonCtrls[skipIndex].isLeftLineShown(true); \r
9304                         } \r
9305                         skipIndex = skipIndex + 2;\r
9306                     }\r
9307                 }\r
9308                 //reposition the dropdown\r
9309                 var ulElem = element.find('ul');\r
9310                 if(ulElem.length > 0) {\r
9311                     var numButtons = rightMostButtonIndex+1;\r
9312                     if(numButtons > 2) {\r
9313                         var offset = (numButtons)*34-70+(numButtons/1.5) + 0.5;\r
9314                         var offSetStr = offset+'px';\r
9315                         angular.element(ulElem).css('left',offSetStr);\r
9316                         angular.element(ulElem).css('border-top-left-radius','0px');\r
9317                     } else {\r
9318                         angular.element(ulElem).css('left','0px');\r
9319                     }\r
9320                 }\r
9321             }\r
9322         }\r
9323     }\r
9324 }]);\r
9325 \r
9326 angular.module('att.abs.stepSlider', ['att.abs.position'])\r
9327         .constant('sliderConstants', {\r
9328             /*\r
9329              The MIT License (MIT)\r
9330              Copyright (c) 2013 Julien Valéry\r
9331              */\r
9332             SLIDER: {\r
9333                 settings: {\r
9334                     from: 1,\r
9335                     to: 40,\r
9336                     step: 1,\r
9337                     smooth: true,\r
9338                     limits: true,\r
9339                     value: "3",\r
9340                     dimension: "",\r
9341                     vertical: false\r
9342                 },\r
9343                 className: "jslider",\r
9344                 selector: ".jslider-"\r
9345             },\r
9346             EVENTS: {\r
9347             },\r
9348             COLORS: {\r
9349                 GREEN: 'green',\r
9350                 BLUE_HIGHLIGHT: 'blue',\r
9351                 MAGENTA: 'magenta',\r
9352                 GOLD: 'gold',\r
9353                 PURPLE: 'purple',\r
9354                 DARK_BLUE: 'dark-blue',\r
9355                 REGULAR: 'regular',\r
9356                 WHITE: 'white'\r
9357             }\r
9358         })\r
9359         .factory('utils', function () {\r
9360             /*\r
9361              The MIT License (MIT)\r
9362              Copyright (c) 2013 Julien Valéry\r
9363              */\r
9364             return {\r
9365                 offset: function (elm) {\r
9366                     var rawDom = elm[0];\r
9367                     var _x = 0;\r
9368                     var _y = 0;\r
9369                     var body = document.documentElement || document.body;\r
9370                     var scrollX = window.pageXOffset || body.scrollLeft;\r
9371                     var scrollY = window.pageYOffset || body.scrollTop;\r
9372                     _x = rawDom.getBoundingClientRect().left + scrollX;\r
9373                     _y = rawDom.getBoundingClientRect().top + scrollY;\r
9374                     return {left: _x, top: _y};\r
9375                 },\r
9376                 roundUpToScale: function (mousePrc, scale, cutOffWidth, cutOffIndex) {\r
9377                     var lowerVal;\r
9378                     var higherVal;\r
9379                     var newMousePrc;\r
9380                     var middle;\r
9381 \r
9382                     for (var index = 1; index < scale.length; index++) {\r
9383                         lowerVal = scale[index - 1];\r
9384                         higherVal = scale[index];\r
9385                         middle = ((higherVal - lowerVal) * .5) + lowerVal;\r
9386                         /*\r
9387                          Handles a situation where the user clicks close to the start point of\r
9388                          the slider but the pointer doesn't move\r
9389                          */\r
9390                         if ((lowerVal === 0 && mousePrc <= middle) || checkEquality(lowerVal, mousePrc)) {\r
9391                             newMousePrc = lowerVal;\r
9392                             break;\r
9393                         }\r
9394                         else if (lowerVal < mousePrc && (mousePrc < higherVal ||\r
9395                                 checkEquality(mousePrc, higherVal)))\r
9396                         {\r
9397                             newMousePrc = higherVal;\r
9398                             break;\r
9399                         }\r
9400                     }\r
9401                     //Check if the newMousePrc is <= the cuttOffPoint\r
9402                     if (cutOffWidth && newMousePrc < cutOffWidth) {\r
9403                         return scale[cutOffIndex];\r
9404                     }\r
9405                     else {\r
9406                         return newMousePrc;\r
9407                     }\r
9408                     /*\r
9409                      Checks to see if 2 points are so close that they are\r
9410                      basically equal.\r
9411                      */\r
9412                     function checkEquality(point1, point2) {\r
9413                         var precision = 0.1;\r
9414                         if (Math.abs(point2 - point1) <= precision) {\r
9415                             return true;\r
9416                         }\r
9417                         return false;\r
9418                     }\r
9419                 },\r
9420                 valueForDifferentScale: function (from, to, prc, prcToValueMapper) {\r
9421                     var decimalPrc = prc / 100;\r
9422                     if (decimalPrc === 0) {\r
9423                         return from;\r
9424                     }\r
9425                     return prcToValueMapper[prc];\r
9426                 },\r
9427                 /* converts the default value Kbps to Mbps or Gbps */\r
9428                 convertToMbpsGbps: function (unitValue, unitLabel, configDecimalPlaces) {\r
9429                     var defaultDecimalPlaces = 3; /* this is the default decimal places as per business requirements */\r
9430                     if (configDecimalPlaces) {\r
9431                         defaultDecimalPlaces = configDecimalPlaces;\r
9432                     }\r
9433 \r
9434                     if ((unitValue > 1024 && unitValue < 1000000) && angular.equals(unitLabel, 'Kbps')) {\r
9435                         unitValue = truncator((unitValue/1000), defaultDecimalPlaces);\r
9436                         unitLabel = 'Mbps';\r
9437                     } else if ((unitValue > 1024 && unitValue < 1000000) && angular.equals(unitLabel, 'Mbps')){\r
9438                         unitValue = truncator((unitValue/1000), defaultDecimalPlaces);\r
9439                         unitLabel = 'Mbps';\r
9440                     } else if (unitValue <= 1024 && angular.equals(unitLabel, 'Mbps')) {\r
9441                         unitLabel = 'Kbps';\r
9442                     } else {\r
9443                         unitLabel = 'Kbps';\r
9444                     }\r
9445 \r
9446                     if (unitValue >= 1000000 && angular.equals(unitLabel, 'Kbps')) {\r
9447                         unitValue = truncator((unitValue/1000000), defaultDecimalPlaces);\r
9448                         unitLabel = 'Gbps';\r
9449                     }\r
9450                     return {\r
9451                         unitValue: unitValue, \r
9452                         unitLabel: unitLabel\r
9453                     };\r
9454                     \r
9455                     function truncator(numToTruncate, intDecimalPlaces) {    \r
9456                         var cnvrtdNum = Math.pow(10, intDecimalPlaces);\r
9457                         return ~~(numToTruncate * cnvrtdNum)/cnvrtdNum;\r
9458                     }\r
9459                 },\r
9460                 getConversionFactorValue: function (value, conversion, firstDimension) {\r
9461                     /*\r
9462                      Loop through the conversion array and keep checking the\r
9463                      startVal\r
9464                      */\r
9465                     if (value <= conversion[0].startVal) {\r
9466                         return{\r
9467                             scaledVal: value,\r
9468                             scaledDimension: firstDimension\r
9469                         };\r
9470                     }\r
9471                     var endIndex = 0;\r
9472                     for (var index in conversion) {\r
9473                         var c = conversion[index];\r
9474                         if (value > c.startVal) {\r
9475                             endIndex = index;\r
9476                         }\r
9477                     }\r
9478                     var scaleFactor = conversion[endIndex].scaleFactor;\r
9479                     var scaledVal = value / scaleFactor;\r
9480                     var scaledDimension = conversion[endIndex].dimension;\r
9481                     return {\r
9482                         scaledVal: scaledVal,\r
9483                         scaledDimension: scaledDimension\r
9484                     };\r
9485                 }\r
9486             };\r
9487         })\r
9488         .factory('sliderDraggable', ['utils', function (utils) {\r
9489                 /*\r
9490                  The MIT License (MIT)\r
9491                  Copyright (c) 2013 Julien Valéry\r
9492                  */\r
9493                 function Draggable() {\r
9494                     this._init.apply(this, arguments);\r
9495                 }\r
9496                 Draggable.prototype.oninit = function () {\r
9497                 };\r
9498                 Draggable.prototype.events = function () {\r
9499                 };\r
9500                 Draggable.prototype.onmousedown = function () {\r
9501                     this.ptr.css({position: "absolute"});\r
9502                 };\r
9503                 Draggable.prototype.onmousemove = function (evt, x, y) {\r
9504                     this.ptr.css({left: x, top: y});\r
9505                 };\r
9506                 Draggable.prototype.onmouseup = function () {\r
9507                 };\r
9508                 Draggable.prototype.isDefault = {\r
9509                     drag: false,\r
9510                     clicked: false,\r
9511                     toclick: true,\r
9512                     mouseup: false\r
9513                 };\r
9514                 Draggable.prototype._init = function () {\r
9515                     if (arguments.length > 0) {\r
9516                         this.ptr = arguments[0];\r
9517                         this.parent = arguments[2];\r
9518                         if (!this.ptr) {\r
9519                             return;\r
9520                         }\r
9521                         this.is = {};\r
9522                         angular.extend(this.is, this.isDefault);\r
9523                         var offset = utils.offset(this.ptr);\r
9524                         this.d = {\r
9525                             left: offset.left,\r
9526                             top: offset.top,\r
9527                             width: this.ptr[0].clientWidth,\r
9528                             height: this.ptr[0].clientHeight\r
9529                         };\r
9530                         this.oninit.apply(this, arguments);\r
9531                         this._events();\r
9532                     }\r
9533                 };\r
9534                 Draggable.prototype._getPageCoords = function (event) {\r
9535                     var value = {};\r
9536                     if (event.targetTouches && event.targetTouches[0]) {\r
9537                         value = {x: event.targetTouches[0].pageX, y: event.targetTouches[0].pageY};\r
9538                     } else {\r
9539                         value = {x: event.pageX, y: event.pageY};\r
9540                     }\r
9541                     return value;\r
9542                 };\r
9543                 Draggable.prototype._bindEvent = function (ptr, eventType, handler) {\r
9544                     if (this.supportTouches_) {\r
9545                         ptr[0].attachEvent(this.events_[ eventType ], handler);\r
9546                     }\r
9547                     else {\r
9548                         if (ptr.bind) {\r
9549                             ptr.bind(this.events_[ eventType ], handler);\r
9550                         }\r
9551                     }\r
9552                 };\r
9553                 Draggable.prototype._events = function () {\r
9554                     var self = this;\r
9555                     this.supportTouches_ = 'ontouchend' in document;\r
9556                     this.events_ = {\r
9557                         "click": this.supportTouches_ ? "touchstart" : "click",\r
9558                         "down": this.supportTouches_ ? "touchstart" : "mousedown",\r
9559                         "move": this.supportTouches_ ? "touchmove" : "mousemove",\r
9560                         "up": this.supportTouches_ ? "touchend" : "mouseup",\r
9561                         "mousedown": this.supportTouches_ ? "mousedown" : "mousedown"\r
9562                     };\r
9563                     var documentElt = angular.element(window.document);\r
9564                     this._bindEvent(documentElt, "move", function (event) {\r
9565                         if (self.is.drag) {\r
9566                             event.stopPropagation();\r
9567                             event.preventDefault();\r
9568                             if (!self.parent.disabled) {\r
9569                                 self._mousemove(event);\r
9570                             }\r
9571                         }\r
9572                     });\r
9573                     this._bindEvent(documentElt, "down", function (event) {\r
9574                         if (self.is.drag) {\r
9575                             event.stopPropagation();\r
9576                             event.preventDefault();\r
9577                         }\r
9578                     });\r
9579                     this._bindEvent(documentElt, "up", function (event) {\r
9580                         self._mouseup(event);\r
9581                     });\r
9582                     this._bindEvent(this.ptr, "down", function (event) {\r
9583                         self._mousedown(event);\r
9584                         return false;\r
9585                     });\r
9586                     this._bindEvent(this.ptr, "up", function (event) {\r
9587                         self._mouseup(event);\r
9588                     });\r
9589                     this.events();\r
9590                 };\r
9591                 Draggable.prototype._mousedown = function (evt) {\r
9592                     this.is.drag = true;\r
9593                     this.is.clicked = false;\r
9594                     this.is.mouseup = false;\r
9595                     var coords = this._getPageCoords(evt);\r
9596                     this.cx = coords.x - this.ptr[0].offsetLeft;\r
9597                     this.cy = coords.y - this.ptr[0].offsetTop;\r
9598                     angular.extend(this.d, {\r
9599                         left: this.ptr[0].offsetLeft,\r
9600                         top: this.ptr[0].offsetTop,\r
9601                         width: this.ptr[0].clientWidth,\r
9602                         height: this.ptr[0].clientHeight\r
9603                     });\r
9604                     if (this.outer && this.outer.get(0)) {\r
9605                         this.outer.css({height: Math.max(this.outer.height(), $(document.body).height()), overflow: "hidden"});\r
9606                     }\r
9607                     this.onmousedown(evt);\r
9608                 };\r
9609                 Draggable.prototype._mousemove = function (evt) {\r
9610                     if (this.uid === 0) {\r
9611                         return;\r
9612                     }\r
9613                     this.is.toclick = false;\r
9614                     var coords = this._getPageCoords(evt);\r
9615                     this.onmousemove(evt, coords.x - this.cx, coords.y - this.cy);\r
9616                 };\r
9617                 Draggable.prototype._mouseup = function (evt) {\r
9618                     if (this.is.drag) {\r
9619                         this.is.drag = false;\r
9620                         if (this.outer && this.outer.get(0)) {\r
9621                             if ($.browser.mozilla) {\r
9622                                 this.outer.css({overflow: "hidden"});\r
9623                             } else {\r
9624                                 this.outer.css({overflow: "visible"});\r
9625                             }\r
9626                             if ($.browser.msie && $.browser.version === '6.0') {\r
9627                                 this.outer.css({height: "100%"});\r
9628                             } else {\r
9629                                 this.outer.css({height: "auto"});\r
9630                             }\r
9631                         }\r
9632                         this.onmouseup(evt);\r
9633                     }\r
9634                 };\r
9635                 return Draggable;\r
9636             }])\r
9637         .factory('sliderPointer', ['sliderDraggable', 'utils', function (Draggable, utils) {\r
9638                 /*\r
9639                  The MIT License (MIT)\r
9640                  Copyright (c) 2013 Julien Valéry\r
9641                  */\r
9642                 function SliderPointer() {\r
9643                     Draggable.apply(this, arguments);\r
9644                 }\r
9645                 SliderPointer.prototype = new Draggable();\r
9646                 SliderPointer.prototype.oninit = function (ptr, id, _constructor) {\r
9647                     this.uid = id;\r
9648                     this.parent = _constructor;\r
9649                     this.value = {};\r
9650                     this.settings = angular.copy(_constructor.settings);\r
9651                 };\r
9652                 SliderPointer.prototype.onmousedown = function (evt) {\r
9653                     var off = utils.offset(this.parent.domNode);\r
9654                     var offset = {\r
9655                         left: off.left,\r
9656                         top: off.top,\r
9657                         width: this.parent.domNode[0].clientWidth,\r
9658                         height: this.parent.domNode[0].clientHeight\r
9659                     };\r
9660                     this._parent = {\r
9661                         offset: offset,\r
9662                         width: offset.width,\r
9663                         height: offset.height\r
9664                     };\r
9665                     this.ptr.addClass("jslider-pointer-hover");\r
9666                     this.setIndexOver();\r
9667                 };\r
9668                 SliderPointer.prototype.onmousemove = function (evt, x, y) {\r
9669                     var coords = this._getPageCoords(evt);\r
9670                     //val is the percent where the slider pointer is located\r
9671                     var val = this.calc(coords.x);\r
9672                     if (!this.parent.settings.smooth) {\r
9673                         val = utils.roundUpToScale(val,\r
9674                                 this.parent.settings.scale,\r
9675                                 this.parent.settings.cutOffWidth,\r
9676                                 this.parent.settings.cutOffIndex);\r
9677                     }\r
9678                     var cutOffWidth = this.parent.settings.cutOffWidth;\r
9679                     if (cutOffWidth && val < cutOffWidth) {\r
9680                         val = cutOffWidth;\r
9681                     }\r
9682                     this._set(val);\r
9683                 };\r
9684                 SliderPointer.prototype.onmouseup = function (evt) {\r
9685                     if (this.settings.callback && angular.isFunction(this.settings.callback)) {\r
9686                         var val = this.parent.getValue();\r
9687                         this.settings.callback.call(this.parent, val);\r
9688                     }\r
9689                     this.ptr.removeClass("jslider-pointer-hover");\r
9690                 };\r
9691                 SliderPointer.prototype.setIndexOver = function () {\r
9692                     this.parent.setPointersIndex(1);\r
9693                     this.index(2);\r
9694                 };\r
9695                 SliderPointer.prototype.index = function (i) {\r
9696                 };\r
9697                 SliderPointer.prototype.limits = function (x) {\r
9698                     return this.parent.limits(x, this);\r
9699                 };\r
9700                 SliderPointer.prototype.calc = function (coords) {\r
9701                     var diff = coords - this._parent.offset.left;\r
9702                     var val = this.limits((diff * 100) / this._parent.width);\r
9703                     return val;\r
9704                 };\r
9705                 SliderPointer.prototype.set = function (value, opt_origin) {\r
9706                     this.value.origin = this.parent.round(value);\r
9707                     this._set(this.parent.valueToPrc(value, this), opt_origin);\r
9708                 };\r
9709                 SliderPointer.prototype._set = function (prc, opt_origin) {\r
9710                     if (!opt_origin) {\r
9711                         this.value.origin = this.parent.prcToValue(prc);\r
9712                     }\r
9713                     this.value.prc = prc;\r
9714                     //Sets the location of the SliderPointer\r
9715                     this.ptr.css({left: prc + '%'});\r
9716                     this.parent.redraw(this);\r
9717                 };\r
9718                 return SliderPointer;\r
9719             }])\r
9720         .factory('slider', ['sliderPointer', 'sliderConstants', 'utils', function (SliderPointer, sliderConstants, utils) {\r
9721                 /*\r
9722                  The MIT License (MIT)\r
9723                  Copyright (c) 2013 Julien Valéry\r
9724                  */\r
9725                 var cutOffDom;\r
9726                 function Slider() {\r
9727                     return this.init.apply(this, arguments);\r
9728                 }\r
9729                 function changeCutOffWidth(width) {\r
9730                     cutOffDom.css('width', width);\r
9731                 }\r
9732                 ;\r
9733                 Slider.prototype.changeCutOffWidth = changeCutOffWidth;\r
9734                 Slider.prototype.init = function (inputNode, templateNode, settings) {\r
9735                     this.settings = sliderConstants.SLIDER.settings;\r
9736                     angular.extend(this.settings, angular.copy(settings));\r
9737                     this.inputNode = inputNode;\r
9738                     this.inputNode.addClass("ng-hide");\r
9739                     this.settings.interval = this.settings.to - this.settings.from;\r
9740                     if (this.settings.calculate && $.isFunction(this.settings.calculate)) {\r
9741                         this.nice = this.settings.calculate;\r
9742                     }\r
9743                     if (this.settings.onstatechange && $.isFunction(this.settings.onstatechange)) {\r
9744                         this.onstatechange = this.settings.onstatechange;\r
9745                     }\r
9746                     this.is = {init: false};\r
9747                     this.o = {};\r
9748                     this.create(templateNode);\r
9749                 };\r
9750                 Slider.prototype.create = function (templateNode) {\r
9751                     var $this = this;\r
9752                     this.domNode = templateNode;\r
9753                     var off = utils.offset(this.domNode);\r
9754                     var offset = {\r
9755                         left: off.left,\r
9756                         top: off.top,\r
9757                         width: this.domNode[0].clientWidth,\r
9758                         height: this.domNode[0].clientHeight\r
9759                     };\r
9760                     this.sizes = {domWidth: this.domNode[0].clientWidth, domOffset: offset};\r
9761                     angular.extend(this.o, {\r
9762                         pointers: {},\r
9763                         labels: {\r
9764                             0: {\r
9765                                 o: angular.element(this.domNode.find('div')[5])\r
9766                             },\r
9767                             1: {\r
9768                                 o: angular.element(this.domNode.find('div')[6])\r
9769                             }\r
9770                         },\r
9771                         limits: {\r
9772                             0: angular.element(this.domNode.find('div')[3]),\r
9773                             1: angular.element(this.domNode.find('div')[5])\r
9774                         }\r
9775                     });\r
9776                     angular.extend(this.o.labels[0], {\r
9777                         value: this.o.labels[0].o.find("span")\r
9778                     });\r
9779                     angular.extend(this.o.labels[1], {\r
9780                         value: this.o.labels[1].o.find("span")\r
9781                     });\r
9782                     if (!$this.settings.value.split(";")[1]) {\r
9783                         this.settings.single = true;\r
9784                     }\r
9785                     var domNodeDivs = this.domNode.find('div');\r
9786                     cutOffDom = angular.element(domNodeDivs[8]);\r
9787                     if (cutOffDom && cutOffDom.css) {\r
9788                         cutOffDom.css('width', '0%');\r
9789                     }\r
9790                     var pointers = [angular.element(domNodeDivs[1]), angular.element(domNodeDivs[2])];\r
9791                     angular.forEach(pointers, function (pointer, key) {\r
9792                         $this.settings = angular.copy($this.settings);\r
9793                         var value = $this.settings.value.split(';')[key];\r
9794                         if (value) {\r
9795                             $this.o.pointers[key] = new SliderPointer(pointer, key, $this);\r
9796                             var prev = $this.settings.value.split(';')[key - 1];\r
9797                             if (prev && parseInt(value, 10) < parseInt(prev, 10)) {\r
9798                                 value = prev;\r
9799                             }\r
9800                             var value1 = value < $this.settings.from ? $this.settings.from : value;\r
9801                             value1 = value > $this.settings.to ? $this.settings.to : value;\r
9802                             $this.o.pointers[key].set(value1, true);\r
9803                             if (key === 0) {\r
9804                                 $this.domNode.bind('mousedown', $this.clickHandler.apply($this));\r
9805                             }\r
9806                         }\r
9807                     });\r
9808                     this.o.value = angular.element(this.domNode.find("i")[2]);\r
9809                     this.is.init = true;\r
9810                     angular.forEach(this.o.pointers, function (pointer) {\r
9811                         $this.redraw(pointer);\r
9812                     });\r
9813                 };\r
9814                 Slider.prototype.clickHandler = function () {\r
9815                     var self = this;\r
9816                     return function (evt) {\r
9817                         if (self.disabled) {\r
9818                             return;\r
9819                         }\r
9820                         var className = evt.target.className;\r
9821                         var targetIdx = 0;\r
9822                         if (className.indexOf('jslider-pointer-to') > 0) {\r
9823                             targetIdx = 1;\r
9824                         }\r
9825                         var _off = utils.offset(self.domNode);\r
9826                         var offset = {\r
9827                             left: _off.left,\r
9828                             top: _off.top,\r
9829                             width: self.domNode[0].clientWidth,\r
9830                             height: self.domNode[0].clientHeight\r
9831                         };\r
9832                         targetIdx = 1;\r
9833                         var targetPtr = self.o.pointers[targetIdx];\r
9834                         targetPtr._parent = {offset: offset, width: offset.width, height: offset.height};\r
9835                         targetPtr._mousemove(evt);\r
9836                         targetPtr.onmouseup();\r
9837                         return false;\r
9838                     };\r
9839                 };\r
9840                 Slider.prototype.disable = function (bool) {\r
9841                     this.disabled = bool;\r
9842                 };\r
9843                 Slider.prototype.nice = function (value) {\r
9844                     return value;\r
9845                 };\r
9846                 Slider.prototype.onstatechange = function () {\r
9847                 };\r
9848                 Slider.prototype.limits = function (x, pointer) {\r
9849                     if (!this.settings.smooth) {\r
9850                         var step = this.settings.step * 100 / (this.settings.interval);\r
9851                         x = Math.round(x / step) * step;\r
9852                     }\r
9853                     var another = this.o.pointers[1 - pointer.uid];\r
9854                     if (another && pointer.uid && x < another.value.prc) {\r
9855                         x = another.value.prc;\r
9856                     }\r
9857                     if (another && !pointer.uid && x > another.value.prc) {\r
9858                         x = another.value.prc;\r
9859                     }\r
9860                     if (x < 0) {\r
9861                         x = 0;\r
9862                     }\r
9863                     if (x > 100) {\r
9864                         x = 100;\r
9865                     }\r
9866                     var val = Math.round(x * 10) / 10;\r
9867                     return val;\r
9868                 };\r
9869                 Slider.prototype.setPointersIndex = function (i) {\r
9870                     angular.forEach(this.getPointers(), function (pointer, i) {\r
9871                         pointer.index(i);\r
9872                     });\r
9873                 };\r
9874                 Slider.prototype.getPointers = function () {\r
9875                     return this.o.pointers;\r
9876                 };\r
9877                 Slider.prototype.onresize = function () {\r
9878                     var self = this;\r
9879                     this.sizes = {\r
9880                         domWidth: this.domNode[0].clientWidth,\r
9881                         domHeight: this.domNode[0].clientHeight,\r
9882                         domOffset: {\r
9883                             left: this.domNode[0].offsetLeft,\r
9884                             top: this.domNode[0].offsetTop,\r
9885                             width: this.domNode[0].clientWidth,\r
9886                             height: this.domNode[0].clientHeight\r
9887                         }\r
9888                     };\r
9889                     angular.forEach(this.o.pointers, function (ptr, key) {\r
9890                         self.redraw(ptr);\r
9891                     });\r
9892                 };\r
9893                 Slider.prototype.update = function () {\r
9894                     this.onresize();\r
9895                     this.drawScale();\r
9896                 };\r
9897                 Slider.prototype.drawScale = function () {\r
9898                 };\r
9899                 Slider.prototype.redraw = function (pointer) {\r
9900                     if (!this.settings.smooth) {\r
9901                         var newMousePrc = utils.roundUpToScale(pointer.value.prc,\r
9902                                 this.settings.scale,\r
9903                                 this.settings.cutOffWidth,\r
9904                                 this.settings.cutOffIndex);\r
9905                         pointer.value.origin = newMousePrc;\r
9906                         pointer.value.prc = newMousePrc;\r
9907                     }\r
9908 \r
9909                     if (!this.is.init) {\r
9910                         return false;\r
9911                     }\r
9912                     this.setValue();\r
9913                     var width = this.o.pointers[1].value.prc;\r
9914                     var newPos = {left: '0%', width: width + '%'};\r
9915                     this.o.value.css(newPos);\r
9916                     var htmlValue = this.nice(pointer.value.origin);\r
9917                     var scaledDimension = this.settings.firstDimension;\r
9918                     if (this.settings.stepWithDifferentScale && !this.settings.smooth) {\r
9919                         htmlValue = utils.valueForDifferentScale(this.settings.from,\r
9920                                 this.settings.to, htmlValue, this.settings.prcToValueMapper);\r
9921                     }\r
9922                     //This is the base value before the conversion\r
9923                     if (this.settings.realtimeCallback && angular.isFunction(this.settings.realtimeCallback)\r
9924                             && this.settings.cutOffVal !== undefined && pointer.uid === 1) {\r
9925                         this.settings.realtimeCallback(htmlValue);\r
9926                     }\r
9927                     //Need to change this to the correct value for the scale\r
9928                     if (this.settings.conversion) {\r
9929                         var conversionObj = utils.getConversionFactorValue(parseInt(htmlValue),\r
9930                                 this.settings.conversion,\r
9931                                 this.settings.firstDimension);\r
9932                         htmlValue = conversionObj.scaledVal;\r
9933                         scaledDimension = conversionObj.scaledDimension;\r
9934                     }\r
9935 \r
9936                     htmlValue = parseFloat(htmlValue);\r
9937                     var tooltipLabel = utils.convertToMbpsGbps(htmlValue, scaledDimension, this.settings.decimalPlaces);\r
9938 \r
9939                     this.o.labels[pointer.uid].value.html(tooltipLabel.unitValue + ' ' + tooltipLabel.unitLabel);\r
9940                     //Top tooltip label\r
9941                     this.redrawLabels(pointer);\r
9942                 };\r
9943                 Slider.prototype.redrawLabels = function (pointer) {\r
9944                     function setPosition(label, sizes, prc) {\r
9945                         sizes.margin = -sizes.label / 2;\r
9946                         var domSize = self.sizes.domWidth;\r
9947                         var label_left = sizes.border + sizes.margin;\r
9948                         if (label_left < 0) {\r
9949                             sizes.margin -= label_left;\r
9950                         }\r
9951                         if (sizes.border + sizes.label / 2 > domSize) {\r
9952                             sizes.margin = 0;\r
9953                             sizes.right = true;\r
9954                         } else\r
9955                             sizes.right = false;\r
9956                         //Adjust the tooltip location\r
9957                         sizes.margin = -((label.o[0].clientWidth / 2) - label.o[0].clientWidth / 20);\r
9958                         label.o.css({left: prc + "%", marginLeft: sizes.margin, right: "auto"});\r
9959                         if (sizes.right)\r
9960                             label.o.css({left: "auto", right: 0});\r
9961                         return sizes;\r
9962                     }\r
9963                     var self = this;\r
9964                     var label = this.o.labels[pointer.uid];\r
9965                     var prc = pointer.value.prc;\r
9966                     var sizes = {\r
9967                         label: label.o[0].offsetWidth,\r
9968                         right: false,\r
9969                         border: (prc * domSize) / 100\r
9970                     };\r
9971                     var another_label = null;\r
9972                     var another = null;\r
9973                     if (!this.settings.single) {\r
9974                         another = this.o.pointers[1 - pointer.uid];\r
9975                         another_label = this.o.labels[another.uid];\r
9976                         switch (pointer.uid) {\r
9977                             case 0:\r
9978                                 if (sizes.border + sizes.label / 2 > another_label.o[0].offsetLeft - this.sizes.domOffset.left) {\r
9979                                     another_label.o.css({visibility: "hidden"});\r
9980                                     another_label.value.html(this.nice(another.value.origin));\r
9981                                     label.o.css({visibility: "hidden"});\r
9982                                     prc = (another.value.prc - prc) / 2 + prc;\r
9983                                     if (another.value.prc !== pointer.value.prc) {\r
9984                                         label.value.html(this.nice(pointer.value.origin) + "&nbsp;&ndash;&nbsp;" + this.nice(another.value.origin));\r
9985                                         sizes.label = label.o[0].clientWidth;\r
9986                                         sizes.border = (prc * domSize) / 100;\r
9987                                     }\r
9988                                 } else {\r
9989                                     another_label.o.css({visibility: "visible"});\r
9990                                 }\r
9991                                 break;\r
9992                             case 1:\r
9993                                 if (sizes.border - sizes.label / 2 < another_label.o[0].offsetLeft - this.sizes.domOffset.left + another_label.o[0].clientWidth) {\r
9994                                     another_label.o.css({visibility: "hidden"});\r
9995                                     another_label.value.html(this.nice(another.value.origin));\r
9996                                     label.o.css({visibility: "visible"});\r
9997                                     prc = (prc - another.value.prc) / 2 + another.value.prc;\r
9998                                     if (another.value.prc !== pointer.value.prc) {\r
9999                                         label.value.html(this.nice(another.value.origin) + "&nbsp;&ndash;&nbsp;" + this.nice(pointer.value.origin));\r
10000                                         sizes.label = label.o[0].clientWidth;\r
10001                                         sizes.border = (prc * domSize) / 100;\r
10002                                     }\r
10003                                 } else {\r
10004                                     another_label.o.css({visibility: "visible"});\r
10005                                 }\r
10006                                 break;\r
10007                         }\r
10008                     }\r
10009                     sizes = setPosition(label, sizes, prc);\r
10010                     var domSize = self.sizes.domWidth;\r
10011                     //This is the 0th pointer\r
10012                     if (another_label) {\r
10013                         sizes = {\r
10014                             label: another_label.o[0].clientWidth,\r
10015                             right: false,\r
10016                             border: (another.value.prc * this.sizes.domWidth) / 100\r
10017                         };\r
10018                         sizes = setPosition(another_label, sizes, another.value.prc);\r
10019                     }\r
10020                 };\r
10021                 Slider.prototype.redrawLimits = function () {\r
10022                     if (this.settings.limits) {\r
10023                         var limits = [true, true];\r
10024                         for (var key in this.o.pointers) {\r
10025                             if (!this.settings.single || key === 0) {\r
10026                                 var pointer = this.o.pointers[key];\r
10027                                 var label = this.o.labels[pointer.uid];\r
10028                                 var label_left = label.o[0].offsetLeft - this.sizes.domOffset.left;\r
10029                                 var limit = this.o.limits[0];\r
10030                                 if (label_left < limit[0].clientWidth)\r
10031                                     limits[0] = false;\r
10032                                 limit = this.o.limits[1];\r
10033                                 if (label_left + label.o[0].clientWidth > this.sizes.domWidth - limit[0].clientWidth)\r
10034                                     limits[1] = false;\r
10035                             }\r
10036                         }\r
10037                         for (var i = 0; i < limits.length; i++) {\r
10038                             if (limits[i]){\r
10039                                 angular.element(this.o.limits[i]).addClass("animate-show");}\r
10040                             else{\r
10041                                 angular.element(this.o.limits[i]).addClass("animate-hidde");}\r
10042                         }\r
10043                     }\r
10044                 };\r
10045                 Slider.prototype.setValue = function () {\r
10046                     var value = this.getValue();\r
10047                     this.inputNode.attr("value", value);\r
10048                     this.onstatechange.call(this, value, this.inputNode);\r
10049                 };\r
10050                 Slider.prototype.getValue = function () {\r
10051                     if (!this.is.init){\r
10052                         return false;}\r
10053                     var $this = this;\r
10054                     var value = "";\r
10055                     angular.forEach(this.o.pointers, function (pointer, key) {\r
10056                         if (pointer.value.prc !== undefined && !isNaN(pointer.value.prc)) {\r
10057                             var pointerPrc = pointer.value.prc;\r
10058                             var myValue = $this.prcToValue(pointerPrc);\r
10059                             if (!$this.settings.smooth) {\r
10060                                 var myValue = utils.valueForDifferentScale($this.settings.from,\r
10061                                         $this.settings.to,\r
10062                                         pointerPrc,\r
10063                                         $this.settings.prcToValueMapper);\r
10064                             }\r
10065                             value += (key > 0 ? ";" : "") + myValue;\r
10066                         }\r
10067                     });\r
10068                     return value;\r
10069                 };\r
10070                 Slider.prototype.getPrcValue = function () {\r
10071                     if (!this.is.init)\r
10072                         return false;\r
10073                     var value = "";\r
10074                     $.each(this.o.pointers, function (i) {\r
10075                         if (this.value.prc !== undefined && !isNaN(this.value.prc))\r
10076                             value += (i > 0 ? ";" : "") + this.value.prc;\r
10077                     });\r
10078                     return value;\r
10079                 };\r
10080                 Slider.prototype.prcToValue = function (prc) {\r
10081                     var value;\r
10082                     if (this.settings.heterogeneity && this.settings.heterogeneity.length > 0) {\r
10083                         var h = this.settings.heterogeneity;\r
10084                         var _start = 0;\r
10085                         var _from = this.settings.from;\r
10086                         for (var i = 0; i <= h.length; i++) {\r
10087                             var v;\r
10088                             if (h[i]){\r
10089                                 v = h[i].split("/");}\r
10090                             else{\r
10091                                 v = [100, this.settings.to];}\r
10092                             if (prc >= _start && prc <= v[0]) {\r
10093                                 value = _from + ((prc - _start) * (v[1] - _from)) / (v[0] - _start);\r
10094                             }\r
10095                             _start = v[0];\r
10096                             _from = v[1];\r
10097                         }\r
10098                     }\r
10099                     else {\r
10100                         value = this.settings.from + (prc * this.settings.interval) / 100;\r
10101                     }\r
10102                     var roundedValue = this.round(value);\r
10103                     return roundedValue;\r
10104                 };\r
10105                 Slider.prototype.valueToPrc = function (value, pointer) {\r
10106                     var prc;\r
10107                     if (this.settings.heterogeneity && this.settings.heterogeneity.length > 0) {\r
10108                         var h = this.settings.heterogeneity;\r
10109                         var _start = 0;\r
10110                         var _from = this.settings.from;\r
10111                         for (var i = 0; i <= h.length; i++) {\r
10112                             var v;\r
10113                             if (h[i])\r
10114                                 v = h[i].split("/");\r
10115                             else\r
10116                                 v = [100, this.settings.to];\r
10117                             if (value >= _from && value <= v[1]) {\r
10118                                 prc = pointer.limits(_start + (value - _from) * (v[0] - _start) / (v[1] - _from));\r
10119                             }\r
10120                             _start = v[0];\r
10121                             _from = v[1];\r
10122                         }\r
10123                     } else {\r
10124                         prc = pointer.limits((value - this.settings.from) * 100 / this.settings.interval);\r
10125                     }\r
10126                     return prc;\r
10127                 };\r
10128                 Slider.prototype.round = function (value) {\r
10129                     value = Math.round(value / this.settings.step) * this.settings.step;\r
10130                     if (this.settings.round){\r
10131                         value = Math.round(value * Math.pow(10, this.settings.round)) / Math.pow(10, this.settings.round);}\r
10132                     else{\r
10133                         value = Math.round(value);}\r
10134                     return value;\r
10135                 };\r
10136                 return Slider;\r
10137             }])\r
10138         .directive('attStepSlider', [\r
10139             '$compile', '$templateCache', '$timeout', '$window', 'slider', 'sliderConstants', 'utils',\r
10140             function (compile, templateCache, timeout, win, Slider, sliderConstants, utils) {\r
10141                 /*\r
10142                  The MIT License (MIT)\r
10143                  Copyright (c) 2013 Julien Valéry\r
10144                  */\r
10145                 var templateUrl = 'app/scripts/ng_js_att_tpls/stepSlider/attStepSlider.html';\r
10146                 return {\r
10147                     restrict: 'AE',\r
10148                     require: '?ngModel',\r
10149                     scope: {\r
10150                         options: '=',\r
10151                         cutOff: '='\r
10152                     },\r
10153                     priority: 1,\r
10154                     templateUrl: templateUrl,\r
10155                     link: function (scope, element, attrs, ngModel) {\r
10156                         if (!ngModel)\r
10157                             return;\r
10158                         scope.mainSliderClass = 'step-slider';\r
10159                         element.after(compile(templateCache.get(templateUrl))(scope, function (clonedElement, scope) {\r
10160                             scope.tmplElt = clonedElement;\r
10161                         }));\r
10162                         ngModel.$render = function () {\r
10163                             if (ngModel.$viewValue.split && ngModel.$viewValue.split(";").length === 1) {\r
10164                                 ngModel.$viewValue = '0;' + ngModel.$viewValue;\r
10165                             } else if (typeof (ngModel.$viewValue) === 'number') {\r
10166                                 ngModel.$viewValue = '0;' + ngModel.$viewValue;\r
10167                             }\r
10168                             if (!ngModel.$viewValue && ngModel.$viewValue !== 0) {\r
10169                                 return;\r
10170                             }\r
10171                             if (typeof (ngModel.$viewValue) === 'number') {\r
10172                                 ngModel.$viewValue = '' + ngModel.$viewValue;\r
10173                             }\r
10174                             if (scope.slider) {\r
10175                                 var firstPointer = '0';\r
10176                                 scope.slider.getPointers()[0].set(firstPointer, true);\r
10177                                 if (ngModel.$viewValue.split(";")[1]) {\r
10178                                     var value = ngModel.$viewValue.split(";")[1];\r
10179                                     if (value.length >= 4) {\r
10180                                         value = value.substring(0, 2);\r
10181                                     }\r
10182                                     if (!scope.options.realtime)\r
10183                                         scope.options.callback(parseFloat(ngModel.$viewValue.split(";")[1]));\r
10184                                     scope.slider.getPointers()[1].set(ngModel.$viewValue.split(";")[1], true);\r
10185                                 }\r
10186                             }\r
10187                         };\r
10188                         var init = function () {\r
10189                             scope.from = '' + scope.options.from;\r
10190                             scope.to = '' + scope.options.to;\r
10191                             if (scope.options.calculate && typeof scope.options.calculate === 'function') {\r
10192                                 scope.from = scope.options.calculate(scope.from);\r
10193                                 scope.to = scope.options.calculate(scope.to);\r
10194                             }\r
10195                             scope.showDividers = scope.options.showDividers;\r
10196                             scope.COLORS = sliderConstants.COLORS;\r
10197                             scope.sliderColor = scope.options.sliderColor;\r
10198                             if (!scope.sliderColor)\r
10199                                 scope.sliderColor = sliderConstants.COLORS.REGULAR;\r
10200                             var scaleArray = scope.options.scale;\r
10201                             /* Make a copy of the scaleArray before converting it to percentage for the bars */\r
10202                             var nonPercentScaleArray = [];\r
10203                             /* Define variable for displaying lower range values */\r
10204                             var scaledUpValueArray=[];\r
10205                             /* Create Mapper for the percentage to value */\r
10206                             var prcToValueMapper = {};\r
10207                             for (var i in scaleArray) {\r
10208                                 var s = scaleArray[i];\r
10209                                 nonPercentScaleArray.push(s);\r
10210                             }\r
10211                             function addScaleArrayStartAndEnd() {\r
10212                                 if (scaleArray[0] !== 0) {\r
10213                                     scaleArray.splice(0, 0, 0);\r
10214                                 }\r
10215                                 if (scaleArray[scaleArray.length - 1] !== 100) {\r
10216                                     scaleArray.splice(scaleArray.length, 0, 100);\r
10217                                 }\r
10218                             }\r
10219                             function convertScaleArrayToPercentage() {\r
10220                                 if (scaleArray[scaleArray.length - 1] !== scope.options.to) {\r
10221                                     scaleArray.splice(scaleArray.length, 0, scope.options.to);\r
10222                                 }\r
10223 \r
10224                                 if(scope.options.displayScaledvalues){\r
10225                                     for(var i in scaleArray){\r
10226                                         scaledUpValueArray.push(Math.log2(scaleArray[i]));\r
10227                                     }\r
10228                                     var maxScaledUpValue=scaledUpValueArray[scaledUpValueArray.length-1];\r
10229                                 }\r
10230 \r
10231                                 for (var i in scaleArray) {\r
10232                                     var prcValue;\r
10233                                     var fromValueCheck = (scaleArray[i] / scope.options.from);\r
10234                                     var toValueCheck = (scaleArray[i] / scope.options.to);\r
10235 \r
10236                                     if (scope.options.displayScaledvalues){\r
10237                                         prcValue = (scaledUpValueArray[i] /maxScaledUpValue)*100;\r
10238                                     } else {\r
10239                                         prcValue = ((scaleArray[i] - scope.options.from) / (scope.options.to - scope.options.from)) * 100;\r
10240                                     }\r
10241 \r
10242                                     var realValue = scaleArray[i];\r
10243 \r
10244                                     if (toValueCheck === 1) {\r
10245                                         prcValue = 100;\r
10246                                     }\r
10247                                     else if (fromValueCheck === 1) {\r
10248                                         prcValue = 0;\r
10249                                     }\r
10250                                     scaleArray[i] = prcValue;\r
10251                                     prcToValueMapper['' + prcValue] = realValue;\r
10252                                 }\r
10253                             }\r
10254                             if ((scope.options.from !== 0 || scope.options.to !== 100)\r
10255                                     && scope.options.smooth) {\r
10256                                 /*\r
10257                                  scale array is in real values.\r
10258                                  */\r
10259                                 addScaleArrayStartAndEnd();\r
10260                                 scope.options.stepWithDifferentScale = true;\r
10261                             }\r
10262                             else if ((scope.options.from !== 0 || scope.options.to !== 100)\r
10263                                     && !scope.options.smooth) {\r
10264                                 /*\r
10265                                  Case for different from and to values other than 0 and 100\r
10266                                  so we have to do some different calculations\r
10267                                  */\r
10268                                 scope.options.stepWithDifferentScale = true;\r
10269                                 convertScaleArrayToPercentage();\r
10270                                 addScaleArrayStartAndEnd();\r
10271                             }\r
10272                             else {\r
10273                                 /*\r
10274                                  This is the normal case where the from and to values are 0 and\r
10275                                  100 respectively.        \r
10276                                  */\r
10277                                 //Check that the scale starts at 0 and 100\r
10278                                 convertScaleArrayToPercentage();\r
10279                                 addScaleArrayStartAndEnd();\r
10280                             }\r
10281                             var decimalPlaces = 0;\r
10282                             if (scope.options.decimalPlaces) {\r
10283                                 decimalPlaces = scope.options.decimalPlaces;\r
10284                             }\r
10285                             //Modify the endDimension based on whether converison was passed in\r
10286                             //Also change the toStr value to scale to the last factor\r
10287                             scope.endDimension = scope.options.dimension;\r
10288                             if (scope.options.conversion) {\r
10289                                 //Get the dimension of the last conversion\r
10290                                 var lastIndex = scope.options.conversion.length - 1;\r
10291                                 var lastDimension = scope.options.conversion[lastIndex].dimension;\r
10292                                 var lastScaleFactor = scope.options.conversion[lastIndex].scaleFactor;\r
10293                                 scope.endDimension = ' ' + lastDimension;\r
10294 \r
10295                                 var toVal = (scope.to / lastScaleFactor).toFixed(decimalPlaces);\r
10296                                 scope.toStr = toVal;\r
10297                             } else {\r
10298                                 scope.toStr = scope.options.to;\r
10299                             }\r
10300 \r
10301                             var tooltipLabel = utils.convertToMbpsGbps(scope.toStr, scope.endDimension, scope.options.decimalPlaces);\r
10302                             scope.toStr = tooltipLabel.unitValue;\r
10303                             scope.endDimension = ' ' + tooltipLabel.unitLabel;\r
10304 \r
10305                             var OPTIONS = {\r
10306                                 from: scope.options.from,\r
10307                                 to: scope.options.to,\r
10308                                 step: scope.options.step,\r
10309                                 smooth: scope.options.smooth,\r
10310                                 limits: true,\r
10311                                 stepWithDifferentScale: scope.options.stepWithDifferentScale,\r
10312                                 round: scope.options.round || false,\r
10313                                 value: ngModel.$viewValue,\r
10314                                 scale: scope.options.scale,\r
10315                                 nonPercentScaleArray: nonPercentScaleArray,\r
10316                                 prcToValueMapper: prcToValueMapper,\r
10317                                 firstDimension: scope.options.dimension,\r
10318                                 decimalPlaces: decimalPlaces,\r
10319                                 conversion: scope.options.conversion,\r
10320                                 realtimeCallback: scope.options.callback\r
10321                             };\r
10322                             if (angular.isFunction(scope.options.realtime)) {\r
10323                                 OPTIONS.realtimeCallback = function (value) {\r
10324                                     ngModel.$setViewValue(value);\r
10325                                     scope.options.callback(value);\r
10326                                 };\r
10327                             }\r
10328                             else {\r
10329                                 OPTIONS.callback = forceApply;\r
10330                             }\r
10331                             OPTIONS.calculate = scope.options.calculate || undefined;\r
10332                             OPTIONS.onstatechange = scope.options.onstatechange || undefined;\r
10333                             timeout(function () {\r
10334                                 var scaleDiv = scope.tmplElt.find('div')[7];\r
10335                                 if (!OPTIONS.conversion) {\r
10336                                     scope.tmplElt.find('div').eq(6).find('span').eq(0).css('padding-left', '10px');\r
10337                                     scope.tmplElt.find('div').eq(6).find('span').eq(0).css('padding-right', '15px');\r
10338                                 }\r
10339                                 scope.slider = angular.element.slider(element, scope.tmplElt, OPTIONS);\r
10340                                 angular.element(scaleDiv).html(scope.generateScale());\r
10341                                 scope.drawScale(scaleDiv);\r
10342                                 initListener();\r
10343                                 scope.$watch('options.disable', function (val) {\r
10344                                     if (scope.slider) {\r
10345                                         scope.tmplElt.toggleClass('disabled', val);\r
10346                                         scope.slider.disable(val);\r
10347                                     }\r
10348                                 });\r
10349                                 scope.$watch('cutOff', function (cutOffVal) {\r
10350                                     if (cutOffVal && cutOffVal > 0) {\r
10351                                         var cutOffPrc = (cutOffVal - scope.slider.settings.from) / (scope.slider.settings.to -\r
10352                                                 scope.slider.settings.from);\r
10353                                         cutOffPrc = cutOffPrc * 100;\r
10354                                         scope.isCutOffSlider = true;\r
10355                                         scope.slider.settings.cutOffWidth = cutOffPrc;\r
10356                                         //cutOffVal is the actual value of the cutoff point\r
10357                                         scope.cutOffVal = cutOffVal;\r
10358                                         if (scope.options.conversion) {\r
10359                                             var convertedVal = utils.getConversionFactorValue(cutOffVal, scope.options.conversion, scope.options.dimension);\r
10360                                             convertedVal.scaledVal = parseFloat(convertedVal.scaledVal).toFixed(scope.options.decimalPlaces);\r
10361                                             scope.cutOffVal = convertedVal.scaledVal + ' ' + convertedVal.scaledDimension;\r
10362                                         }\r
10363                                         scope.slider.settings.cutOffVal = cutOffVal;\r
10364                                         //Calculate the cutOff percentage\r
10365                                         scope.slider.changeCutOffWidth(cutOffPrc + '%');\r
10366                                         var scale = scope.slider.settings.nonPercentScaleArray;\r
10367                                         //Calculate where the cutOff point in relation to the scale array\r
10368                                         for (var i in scale) {\r
10369                                             if (i >= 1) {\r
10370                                                 var lowerVal = scale[i - 1];\r
10371                                                 var higherVal = scale[i];\r
10372                                                 if (cutOffVal > lowerVal && cutOffVal <= higherVal) {\r
10373                                                     scope.slider.settings.cutOffIndex = i;\r
10374                                                 }\r
10375                                             }\r
10376                                         }\r
10377                                     } else {\r
10378                                         scope.slider.settings.cutOffVal = 0;\r
10379                                     }\r
10380                                 });\r
10381                             });\r
10382                         };\r
10383                         function initListener() {\r
10384                             angular.element(win).bind('resize', function (event) {\r
10385                                 scope.slider.onresize();\r
10386                             });\r
10387                         }\r
10388                         scope.generateScale = function () {\r
10389                             if (scope.options.scale && scope.options.scale.length > 0) {\r
10390                                 var str = "";\r
10391                                 var s = scope.options.scale;\r
10392                                 var position = 'left';\r
10393                                 for (var i = 0; i < s.length; i++) {\r
10394                                     if (i !== 0 && i !== s.length - 1) {\r
10395                                         var scaledPosition = ((s[i] - scope.from) / (scope.to - scope.from)) * 100;\r
10396                                         if (scope.options.stepWithDifferentScale && !scope.options.smooth) {\r
10397                                             scaledPosition = s[i];\r
10398                                         }\r
10399                                         str += '<span style="' + position + ': ' + scaledPosition + '%"></span>';\r
10400                                     }\r
10401                                 }\r
10402                                 return str;\r
10403                             } else\r
10404                                 return "";\r
10405                             return "";\r
10406                         };\r
10407                         scope.drawScale = function (scaleDiv) {\r
10408                             angular.forEach(angular.element(scaleDiv).find('ins'), function (scaleLabel, key) {\r
10409                                 scaleLabel.style.marginLeft = -scaleLabel.clientWidth / 2;\r
10410                             });\r
10411                         };\r
10412                         var forceApply = function (value) {\r
10413                             var val = value.split(";")[1];\r
10414                             scope.$apply(function () {\r
10415                                 ngModel.$setViewValue(parseInt(val));\r
10416                             });\r
10417                             if (scope.options.callback) {\r
10418                                 scope.options.callback(parseInt(val));\r
10419                             }\r
10420                         };\r
10421                         scope.$watch('options', function (value) {\r
10422                             init();\r
10423                         });\r
10424                         angular.element.slider = function (inputElement, element, settings) {\r
10425                             if (!element.data('jslider'))\r
10426                                 element.data('jslider', new Slider(inputElement, element, settings));\r
10427                             var sliderObj = element.data('jslider');\r
10428                             return sliderObj;\r
10429                         };\r
10430                     }\r
10431                 };\r
10432             }]);\r
10433 angular.module('att.abs.steptracker', ['att.abs.transition'])\r
10434         .directive('steptracker', ['$timeout', function ($timeout) {\r
10435                 return {\r
10436                     // This allows dev's clickHandler to cancel an operation\r
10437                     priority: 100,\r
10438                     scope: {\r
10439                         sdata: "=sdata",\r
10440                         cstep: "=currentStep",\r
10441                         clickHandler: '=?',\r
10442                         disableClick: '=?'\r
10443                     },\r
10444                     restrict: 'EA',\r
10445                     replace: true,\r
10446                     templateUrl: 'app/scripts/ng_js_att_tpls/steptracker/step-tracker.html',\r
10447                     link: function (scope, elem) {\r
10448                         if (scope.disableClick === undefined) {\r
10449                             scope.disableClick = false;\r
10450                         }\r
10451                         $timeout(function () {\r
10452                             if (scope.cstep < 1) {\r
10453                                 scope.cstep = 1;\r
10454                             }\r
10455                             else if (scope.cstep > scope.sdata.length) {\r
10456                                 scope.cstep = scope.sdata.length;\r
10457                             }\r
10458                             var divs = elem.find('div');\r
10459                             var slidertracks = [];\r
10460                             for (var i in divs) {\r
10461                                 if (divs.eq(i)[0]) {\r
10462                                     var el = divs.eq(i)[0].className;\r
10463                                     if (el.indexOf('track ng-scope') > -1) {\r
10464                                         slidertracks.push(divs.eq(i));\r
10465                                     }\r
10466                                 }\r
10467                             }\r
10468                             var currentPage,totalPage,currentTrack = updateCurrentTrack(scope.cstep);\r
10469                             function updateCurrentTrack(step) {\r
10470                                 // Always return the step-1 because array starts at 0\r
10471                                 return angular.element(slidertracks[step - 1]);\r
10472                             }\r
10473                             function updateTrackWidth() {\r
10474                                 if (scope.cstep > 0 && scope.cstep <= scope.sdata.length - 1 && currentPage > 0) {\r
10475                                     var newWidth = ((currentPage / totalPage) * 100) + "%";\r
10476                                     currentTrack = updateCurrentTrack(scope.cstep);\r
10477                                     currentTrack.css('width', newWidth);\r
10478                                 }\r
10479                             }\r
10480                             function updatePages() {\r
10481                                 if (scope.cstep <= scope.sdata.length) {\r
10482                                     currentPage = scope.sdata[scope.cstep - 1]['currentPage'];\r
10483                                     totalPage = scope.sdata[scope.cstep - 1]['totalPages'];\r
10484                                 }\r
10485                             }\r
10486                             // dynamically add width for steps, depending on the number of steps.\r
10487                             scope.set_width = function (indexval) {\r
10488                                 var setwidth = (100 / (scope.sdata.length - 1)) + "%";\r
10489                                 // skip last element and add width for all other element\r
10490                                 if ((scope.sdata.length - 1) > indexval) {\r
10491                                     return {'width': setwidth};\r
10492                                 }\r
10493                             };\r
10494                             scope.$watch('sdata', function () {\r
10495                                 updatePages();\r
10496                                 var prevStep = scope.cstep;\r
10497                                 // Before anything, ensure currentPage is never below 1\r
10498                                 if (currentPage < 1) {\r
10499                                     currentPage = 1;\r
10500                                     if (scope.cstep !== 1) {\r
10501                                         // Decrease step, current track width is 0%, new step width updates\r
10502                                         scope.cstep--;\r
10503                                         updatePages();\r
10504                                     }\r
10505                                 }\r
10506                                 // Move to next step, reset currentPage, totalPage, and ensure previous steps are completed\r
10507                                 if (currentPage > totalPage) {\r
10508                                     if (scope.cstep > scope.sdata.length - 1) {\r
10509                                         scope.cstep++;\r
10510                                         return;\r
10511                                     } else {\r
10512                                         currentPage = totalPage;\r
10513                                         updateTrackWidth();\r
10514                                         scope.cstep++;\r
10515                                         updatePages();\r
10516                                         updateTrackWidth();\r
10517                                     }\r
10518                                 }\r
10519                                 if (currentPage < 1 && prevStep === scope.cstep) {\r
10520                                     currentPage = 1;\r
10521                                     if (scope.cstep > 1) {\r
10522                                         scope.cstep--;\r
10523                                         scope.sdata[scope.cstep - 1]['currentPage'] = scope.sdata[scope.cstep - 1]['totalPages'];\r
10524                                         scope.sdata[scope.cstep]['currentPage'] = 1;\r
10525                                     }\r
10526                                 }\r
10527                                 updateTrackWidth();\r
10528                             }, true);\r
10529                             //add the active class for current step\r
10530                             scope.activestep = function (index) {\r
10531                                 return (index === scope.cstep - 1);\r
10532                             };\r
10533                             //add the done class for finished step\r
10534                             scope.donesteps = function (index) {\r
10535                                 return (index < scope.cstep - 1);\r
10536                             };\r
10537                             //add the last class for final step\r
10538                             scope.laststep = function (index) {\r
10539                                 return (index === scope.sdata.length - 1);\r
10540                             };\r
10541                             scope.isIncomplete = function (index) {\r
10542                                 if (index === scope.cstep - 1) {\r
10543                                     return false;\r
10544                                 }\r
10545                                 if (index >= 0 && index < scope.sdata.length - 1) {\r
10546                                     var step = scope.sdata[index];\r
10547                                     return (step['currentPage'] <= step['totalPages']);\r
10548                                 }\r
10549                             };\r
10550                             //click event\r
10551                             scope.stepclick = function ($event, steps) {\r
10552                                 // If we are decreasing steps, reset all currentPage counts to 1\r
10553                                 if (steps < scope.cstep) {\r
10554                                     for (var i = scope.cstep - 1; i > steps; i--) {\r
10555                                         scope.sdata[i]['currentPage'] = 1;\r
10556                                     }\r
10557                                     scope.sdata[steps]['currentPage']--;\r
10558                                 }\r
10559                                 if (angular.isFunction(scope.clickHandler)) {\r
10560                                     scope.clickHandler($event, steps);\r
10561                                 }\r
10562                                 scope.cstep = steps + 1;\r
10563                                 // In the case we decremented previously from this step, we need to reset currentpage to default\r
10564                                 if (scope.cstep <= scope.sdata.length && scope.sdata[scope.cstep]['currentPage'] < 1) {\r
10565                                     scope.sdata[scope.cstep]['currentPage'] = 1;\r
10566                                 }\r
10567                                 updatePages();\r
10568                                 updateTrackWidth();\r
10569                             };\r
10570                         }, 100);\r
10571                     }\r
10572                 };\r
10573             }\r
10574         ])\r
10575         .constant('timelineConstants', {\r
10576             STEP_TYPE: {\r
10577                 ALERT: 'alert',\r
10578                 COMPLETED: 'completed',\r
10579                 CANCELLED: 'cancelled'\r
10580             }\r
10581         })\r
10582         .controller('AttTimelineCtrl', ['$scope', '$timeout', function ($scope, $timeout) {\r
10583                 var timelineBarCtrls = [];\r
10584                 var timelineDotCtrls = [];\r
10585                 this.numSteps = 0;\r
10586                 this.isAlternate = function () {\r
10587                     return $scope.alternate;\r
10588                 };\r
10589                 this.addTimelineBarCtrls = function (t) {\r
10590                     timelineBarCtrls.push(t);\r
10591                 };\r
10592                 this.addTimelineDotCtrls = function (b) {\r
10593                     timelineDotCtrls.push(b);\r
10594                 };\r
10595                 $timeout(init, 200);\r
10596                 function init() {\r
10597                     function compare(a, b) {\r
10598                         if (a.order < b.order) {\r
10599                             return -1;\r
10600                         }\r
10601                         if (a.order > b.order) {\r
10602                             return 1;\r
10603                         }\r
10604                         return 0;\r
10605                     }\r
10606                     timelineDotCtrls.sort(compare);\r
10607                     timelineBarCtrls.sort(compare);\r
10608                     if ($scope.$parent.animate) {\r
10609                         animateSequence();\r
10610                     }\r
10611                     $scope.$watch('trigger', function (val) {\r
10612                         if (val) {\r
10613                             $scope.resetTimeline();\r
10614                         } else {\r
10615                             $scope.$parent.animate = false;\r
10616                         }\r
10617                     });\r
10618                 }\r
10619                 function animateSequence() {\r
10620                     var dotsDuration = .25;\r
10621                     var timelineBarProgressDuration = .25;\r
10622                     if (typeof $scope.barAnimateDuration === 'number') {\r
10623                         timelineBarProgressDuration = $scope.barAnimateDuration;\r
10624                     }\r
10625                     var start = createAnimation(0, timelineBarProgressDuration);\r
10626                     function setToInactiveStates() {\r
10627                         for (var i in timelineDotCtrls) {\r
10628                             var dotCtrl = timelineDotCtrls[i];\r
10629                             if (i % 2 === 0) {\r
10630                                 dotCtrl.unhoveredStateForBelow(.25);\r
10631                             } else {\r
10632                                 dotCtrl.unhoveredStateForAbove(.25);\r
10633                             }\r
10634                             if (dotCtrl.isStop()) {\r
10635                                 break;\r
10636                             }\r
10637                         }\r
10638                     }\r
10639                     function createAnimation(i, duration) {\r
10640                         if (i === 0) {\r
10641                             return function () {\r
10642                                 if (timelineDotCtrls[i + 1].isStop() && timelineDotCtrls[i + 1].isCancelled()) {\r
10643                                     timelineBarCtrls[i].isCancelled(true);\r
10644                                 }\r
10645                                 timelineBarCtrls[i].animate(createAnimation(i + 1, duration), duration);\r
10646                             };\r
10647                         } else if (i === timelineBarCtrls.length - 1) {\r
10648                             return function () {\r
10649                                 //Removes the bolded text from the start\r
10650                                 if (timelineDotCtrls[0].isCurrentStep()) {\r
10651                                     timelineDotCtrls[0].isCurrentStep(false);\r
10652                                 }\r
10653                                 if (timelineDotCtrls[i].isStop()) {\r
10654                                     timelineDotCtrls[i - 1].shrinkAnimate(dotsDuration);\r
10655                                     timelineDotCtrls[i].isCurrentStep(true);\r
10656                                 } else {\r
10657                                     timelineDotCtrls[i - 1].shrinkAnimate(dotsDuration);\r
10658                                     timelineBarCtrls[i].animate(createAnimation(i + 1, duration), duration);\r
10659                                 }\r
10660                                 timelineDotCtrls[i].expandedAnimate(dotsDuration);\r
10661                                 $timeout(function () {\r
10662                                     setToInactiveStates();\r
10663                                 }, 500);\r
10664                             };\r
10665                         }\r
10666                         //End Dot\r
10667                         else if (i === timelineBarCtrls.length) {\r
10668                             return function () {\r
10669                                 //Removes the bolded text from the start\r
10670                                 if (timelineDotCtrls[0].isCurrentStep()) {\r
10671                                     timelineDotCtrls[0].isCurrentStep(false);\r
10672                                 }\r
10673                                 timelineDotCtrls[i - 1].shrinkAnimate(dotsDuration);\r
10674                                 timelineDotCtrls[i].expandedAnimate(dotsDuration);\r
10675                                 timelineDotCtrls[i].isCurrentStep(true);\r
10676                                 $timeout(function () {\r
10677                                     setToInactiveStates();\r
10678                                 }, 500);\r
10679                             };\r
10680                         }\r
10681                         else {\r
10682                             return function () {\r
10683                                 //Removes the bolded text from the start\r
10684                                 if (timelineDotCtrls[0].isCurrentStep()) {\r
10685                                     timelineDotCtrls[0].isCurrentStep(false);\r
10686                                 }\r
10687                                 if (timelineDotCtrls[i].isStop()) {\r
10688                                     timelineDotCtrls[i - 1].shrinkAnimate(dotsDuration);\r
10689                                     timelineDotCtrls[i].expandedAnimate(dotsDuration);\r
10690                                     timelineDotCtrls[i].isCurrentStep(true);\r
10691                                     $timeout(function () {\r
10692                                         setToInactiveStates();\r
10693                                     }, 500);\r
10694                                 } else {\r
10695                                     if (timelineDotCtrls[i + 1].isStop() && timelineDotCtrls[i + 1].isCancelled()) {\r
10696                                         timelineBarCtrls[i].isCancelled(true);\r
10697                                     }\r
10698                                     timelineDotCtrls[i - 1].shrinkAnimate(dotsDuration);\r
10699                                     timelineBarCtrls[i].animate(createAnimation(i + 1, duration), duration);\r
10700                                     timelineDotCtrls[i].expandedAnimate(dotsDuration);\r
10701                                 }\r
10702                             };\r
10703                         }\r
10704                     }\r
10705                     start();\r
10706                 }\r
10707             }])\r
10708         .directive('attTimeline', ['$timeout', '$compile', function ($timeout, $compile) {\r
10709                 return {\r
10710                     restrict: 'EA',\r
10711                     replace: true,\r
10712                     scope: {\r
10713                         steps: '=',\r
10714                         trigger: '=',\r
10715                         alternate: '=',\r
10716                         barAnimateDuration: '='\r
10717                     },\r
10718                     templateUrl: 'app/scripts/ng_js_att_tpls/steptracker/timeline.html',\r
10719                     controller: 'AttTimelineCtrl',\r
10720                     link: function (scope, element, attrs, ctrl) {\r
10721                         var init = function () {\r
10722                             var steps = scope.steps;\r
10723                             var middleSteps = [];\r
10724                             for (var i = 1; i < steps.length; i++) {\r
10725                                 var aStep = steps[i];\r
10726                                 middleSteps.push(aStep);\r
10727                             }\r
10728                             scope.middleSteps = middleSteps;\r
10729                             //Used in calculating the width of the loading bars\r
10730                             ctrl.numSteps = steps.length - 1;\r
10731                         };\r
10732                         init();\r
10733                         //Recompile in case of scope changes\r
10734                         scope.resetTimeline = function () {\r
10735                             scope.animate = true;\r
10736                             $compile(element)(scope);\r
10737                         };\r
10738                     }\r
10739                 };\r
10740             }])\r
10741         .controller('TimelineBarCtrl', ['$scope', function ($scope) {\r
10742                 this.type = 'timelinebar';\r
10743                 this.order = parseInt($scope.order);\r
10744                 this.animate = function (callback, duration) {\r
10745                     $scope.loadingAnimation(callback, duration);\r
10746                 };\r
10747                 this.isCancelled = function (isCancelled) {\r
10748                     $scope.isCancelled = isCancelled;\r
10749                 };\r
10750             }])\r
10751         .directive('timelineBar', ['animation', '$progressBar', function (animation, $progressBar) {\r
10752                 return {\r
10753                     restrict: 'EA',\r
10754                     replace: true,\r
10755                     templateUrl: 'app/scripts/ng_js_att_tpls/steptracker/timelineBar.html',\r
10756                     scope: {\r
10757                         order: '@'\r
10758                     },\r
10759                     require: ['^attTimeline', 'timelineBar'],\r
10760                     controller: 'TimelineBarCtrl',\r
10761                     link: function (scope, element, attrs, ctrls) {\r
10762                         var attTimelineCtrl = ctrls[0];\r
10763                         var timelineBarCtrl = ctrls[1];\r
10764                         attTimelineCtrl.addTimelineBarCtrls(timelineBarCtrl);\r
10765                         scope.isCompleted = true;\r
10766                         var widthPerc = (100 / attTimelineCtrl.numSteps) - 3;\r
10767                         element.css('width', widthPerc + '%');\r
10768                         var elem = element.find('div').eq(0);\r
10769                         animation.set(elem, {opacity: 0.0});\r
10770                         var updateCallback = function (selfElement) {\r
10771                             animation.set(elem, {opacity: 1.0});\r
10772                             animation.set(elem, {\r
10773                                 scaleX: selfElement.progress(),\r
10774                                 transformOrigin: "left"\r
10775                             });\r
10776                         };\r
10777                         scope.loadingAnimation = $progressBar(updateCallback);\r
10778                     }\r
10779                 };\r
10780             }])\r
10781         .controller('TimelineDotCtrl', ['$scope', '$timeout', 'timelineConstants', function ($scope, $timeout, timelineConstants) {\r
10782                 this.type = 'dot';\r
10783                 this.order = parseInt($scope.order);\r
10784                 var self = this;\r
10785                 $timeout(function () {\r
10786                     if (self.order !== 0) {\r
10787                         if (self.order % 2 !== 0) {\r
10788                             $scope.initializeAboveForAnimation();\r
10789                         }\r
10790                         else {\r
10791                             $scope.initializeBelowForAnimation();\r
10792                         }\r
10793                     }\r
10794                 });\r
10795                 this.expandedAnimate = function (duration) {\r
10796                     $scope.setColor();\r
10797                     $scope.expandedAnimate(duration);\r
10798                     if (self.order !== 0 && !$scope.isStepsLessThanFive()) {\r
10799                         if (self.order % 2 !== 0) {\r
10800                             $scope.expandContentForAbove(duration);\r
10801                         } else {\r
10802                             $scope.expandContentForBelow(duration);\r
10803                         }\r
10804                     }\r
10805                 };\r
10806                 this.unhoveredStateForAbove = function (duration) {\r
10807                     $scope.unhoveredStateForAbove(duration);\r
10808                 };\r
10809                 this.unhoveredStateForBelow = function (duration) {\r
10810                     $scope.unhoveredStateForBelow(duration);\r
10811                 };\r
10812                 this.shrinkAnimate = function (duration) {\r
10813                     $scope.shrinkAnimate(duration);\r
10814                 };\r
10815                 this.setExpanded = function () {\r
10816                     $scope.setSize(3);\r
10817                 };\r
10818                 this.isStop = function () {\r
10819                     return $scope.isStop;\r
10820                 };\r
10821                 this.isCancelled = function () {\r
10822                     return ($scope.type === timelineConstants.STEP_TYPE.CANCELLED);\r
10823                 };\r
10824                 this.isAlert = function () {\r
10825                     return ($scope.type === timelineConstants.STEP_TYPE.ALERT);\r
10826                 };\r
10827                 //Sets the bolded text\r
10828                 this.isCurrentStep = function (isCurrentStep) {\r
10829                     if (isCurrentStep !== undefined) {\r
10830                         $scope.isCurrentStep = isCurrentStep;\r
10831                     }\r
10832                     return $scope.isCurrentStep;\r
10833                 };\r
10834             }])\r
10835         .directive('timelineDot', ['animation', 'timelineConstants',\r
10836             function (animation, timelineConstants) {\r
10837                 return {\r
10838                     restrict: 'EA',\r
10839                     replace: true,\r
10840                     scope: {\r
10841                         order: '@',\r
10842                         title: '@',\r
10843                         description: '@',\r
10844                         by: '@',\r
10845                         date: '@',\r
10846                         type: '@'\r
10847                     },\r
10848                     templateUrl: 'app/scripts/ng_js_att_tpls/steptracker/timelineDot.html',\r
10849                     require: ['^attTimeline', 'timelineDot'],\r
10850                     controller: 'TimelineDotCtrl',\r
10851                     link: function (scope, element, attrs, ctrls) {\r
10852                         var attTimelineCtrl = ctrls[0];\r
10853                         var timelineDotCtrl = ctrls[1];\r
10854                         attTimelineCtrl.addTimelineDotCtrls(timelineDotCtrl);\r
10855                         scope.numSteps = attTimelineCtrl.numSteps + 1;\r
10856                         scope.isCurrentStep = false;\r
10857                         scope.isCompleted = false;\r
10858                         scope.isStop = false;\r
10859                         if (scope.type === timelineConstants.STEP_TYPE.ALERT || scope.type === timelineConstants.STEP_TYPE.CANCELLED) {\r
10860                             scope.isStop = true;\r
10861                         }\r
10862                         scope.isInactive = true;\r
10863                         var divs = element.find('div');\r
10864                         var biggerCircleElem = divs.eq(0);\r
10865                         var expandableCircleElem = divs.eq(2);\r
10866                         var infoboxElem = divs.eq(3);\r
10867                         var titleElem = divs.eq(5);\r
10868                         var contentElem = divs.eq(6);\r
10869                         var dateElem = divs.eq(9);\r
10870                         function isEmptyStep() {\r
10871                             if (!scope.description && !scope.by && !scope.date) {\r
10872                                 return true;\r
10873                             }\r
10874                             return false;\r
10875                         }\r
10876                         scope.isStepsLessThanFive = function () {\r
10877                             if (scope.numSteps < 5) {\r
10878                                 return true;\r
10879                             }\r
10880                             return false;\r
10881                         };\r
10882                         scope.titleMouseover = function (num) {\r
10883                             if (!scope.isStepsLessThanFive() && !isEmptyStep()) {\r
10884                                 if (num === 1 && scope.order % 2 === 0) {\r
10885                                     scope.expandContentForBelow(.25);\r
10886                                 }\r
10887                                 if (num === 2 && scope.order % 2 !== 0) {\r
10888                                     scope.expandContentForAbove(.25);\r
10889                                 }\r
10890                             }\r
10891                         };\r
10892                         scope.titleMouseleave = function () {\r
10893                             if (scope.order % 2 === 0) {\r
10894                                 scope.unhoveredStateForBelow(.25);\r
10895                             }\r
10896                             else {\r
10897                                 scope.unhoveredStateForAbove(.25);\r
10898                             }\r
10899                         };\r
10900                         scope.initializeAboveForAnimation = function () {\r
10901                             if (!scope.isStepsLessThanFive() && attTimelineCtrl.isAlternate()) {\r
10902                                 animation.set(contentElem, {opacity: 0});\r
10903                                 animation.set(dateElem, {opacity: 0});\r
10904                                 if (!isEmptyStep()) {\r
10905                                     var yOffset = contentElem[0].offsetHeight + dateElem[0].offsetHeight;\r
10906                                     animation.set(titleElem, {'top': yOffset});\r
10907                                 }\r
10908                             }\r
10909                         };\r
10910                         scope.expandContentForAbove = function (duration) {\r
10911                             if (!scope.isStepsLessThanFive() && attTimelineCtrl.isAlternate()) {\r
10912                                 animation.to(titleElem, duration, {'top': 0});\r
10913                                 animation.to(contentElem, duration, {opacity: 1});\r
10914                                 animation.to(dateElem, duration, {opacity: 1});\r
10915                             }\r
10916                         };\r
10917                         scope.unhoveredStateForAbove = function (duration) {\r
10918                             if (!scope.isStepsLessThanFive() && attTimelineCtrl.isAlternate()) {\r
10919                                 animation.set(contentElem, {opacity: 0});\r
10920                                 animation.set(dateElem, {opacity: 1});\r
10921                                 var yOffset = contentElem[0].offsetHeight;\r
10922                                 animation.to(titleElem, duration, {'top': yOffset});\r
10923                             }\r
10924                         };\r
10925                         scope.initializeBelowForAnimation = function () {\r
10926                             if (!scope.isStepsLessThanFive() && attTimelineCtrl.isAlternate()) {\r
10927                                 animation.set(contentElem, {height: '0%', opacity: 0, top: '-20px'});\r
10928                                 animation.set(dateElem, {opacity: 0});\r
10929                             }\r
10930                         };\r
10931                         scope.expandContentForBelow = function (duration) {\r
10932                             if (!scope.isStepsLessThanFive() && attTimelineCtrl.isAlternate()) {\r
10933                                 animation.set(dateElem, {opacity: 1});\r
10934                                 animation.to(contentElem, duration, {height: 'auto', opacity: 1, top: '0px'});\r
10935                             }\r
10936                         };\r
10937                         scope.unhoveredStateForBelow = function (duration) {\r
10938                             if (!scope.isStepsLessThanFive() && attTimelineCtrl.isAlternate()) {\r
10939                                 animation.to(contentElem, duration, {height: '0%', opacity: 0, top: '-20px', position: 'relative'});\r
10940                                 animation.set(dateElem, {opacity: 1});\r
10941                             }\r
10942                         };\r
10943                         /*Default Initializaztion*/\r
10944                         //If the info box is above and the description and date and by are empty then we have do reset its position\r
10945                         if (isEmptyStep() && (scope.order % 2 !== 0 && attTimelineCtrl.isAlternate())) {\r
10946                             infoboxElem.css('top', '-47px');\r
10947                         }\r
10948                         //Check if the order is odd and set the appropiate above or below and other effects\r
10949                         if (scope.order % 2 === 0 || !attTimelineCtrl.isAlternate()) {\r
10950                             scope.isBelowInfoBoxShown = true;\r
10951                         }\r
10952                         else {\r
10953                             scope.isBelowInfoBoxShown = false;\r
10954                         }\r
10955                         //modify some css for steps less than 5 and not alternating\r
10956                         if (scope.isStepsLessThanFive() && !attTimelineCtrl.isAlternate()) {\r
10957                             animation.set(dateElem, {marginTop: 10});\r
10958                         }\r
10959                         //For IE 8 fix\r
10960                         animation.set(biggerCircleElem, {opacity: '.5'});\r
10961                         //shrink the expandableCircle to we can expand it later\r
10962                         animation.set(expandableCircleElem, {opacity: '0.0'});\r
10963                         animation.set(expandableCircleElem, {scale: .10});\r
10964                         if (scope.order === 0) {\r
10965                             animation.set(expandableCircleElem, {opacity: '1.0'});\r
10966                             animation.set(expandableCircleElem, {scale: 1});\r
10967                             animation.set(biggerCircleElem, {scale: 3});\r
10968                             scope.isCurrentStep = true;\r
10969                             scope.isInactive = false;\r
10970                             scope.isCompleted = true;\r
10971                         }\r
10972                         scope.setColor = function () {\r
10973                             scope.isInactive = false;\r
10974                             if (scope.type === timelineConstants.STEP_TYPE.CANCELLED) {\r
10975                                 scope.isCancelled = true;\r
10976                             }\r
10977                             else if (scope.type === timelineConstants.STEP_TYPE.ALERT) {\r
10978                                 scope.isAlert = true;\r
10979                             }\r
10980                             else {\r
10981                                 scope.isCompleted = true;\r
10982                             }\r
10983                             if (!scope.$phase) {\r
10984                                 scope.$apply();\r
10985                             }\r
10986                         };\r
10987                         scope.setSize = function (size) {\r
10988                             animation.set(biggerCircle, {scale: size});\r
10989                         };\r
10990                         scope.setExpandedCircle = function () {\r
10991                             animation.set(expandableCircleElem, {opacity: '1.0'});\r
10992                             animation.set(expandableCircleElem, {scale: 1});\r
10993                         };\r
10994                         scope.expandedAnimate = function (duration) {\r
10995                             animation.to(biggerCircleElem, duration, {scale: 3});\r
10996                             animation.set(expandableCircleElem, {opacity: '1.0'});\r
10997                             animation.to(expandableCircleElem, duration, {scale: 1});\r
10998                         };\r
10999                         scope.shrinkAnimate = function (duration) {\r
11000                             animation.to(biggerCircleElem, duration, {scale: 1});\r
11001                         };\r
11002                     }\r
11003                 };\r
11004             }]);\r
11005 angular.module('att.abs.table', ['att.abs.utilities'])\r
11006 .constant('tableConfig', {\r
11007     //true for descending & false for ascending\r
11008     defaultSortPattern: false,\r
11009     highlightSearchStringClass: 'tablesorter-search-highlight'\r
11010 })\r
11011 \r
11012 .directive('attTable', ['$filter', function($filter) {\r
11013     return {\r
11014         restrict: 'EA',\r
11015         replace: true,\r
11016         transclude: true,\r
11017         scope: {\r
11018             tableData: "=",\r
11019             viewPerPage: "=",\r
11020             currentPage: "=",\r
11021             totalPage: "=",\r
11022             searchCategory: "=",\r
11023             searchString: "="\r
11024         },\r
11025         require: 'attTable',\r
11026         templateUrl: 'app/scripts/ng_js_att_tpls/table/attTable.html',\r
11027         controller: ['$scope', function($scope) {\r
11028             this.headers = [];\r
11029             this.currentSortIndex = null;\r
11030             this.setIndex = function(headerScope) {\r
11031                 this.headers.push(headerScope);\r
11032             };\r
11033             this.getIndex = function(headerName) {\r
11034                 for (var i = 0; i < this.headers.length; i++) {\r
11035                     if (this.headers[i].headerName === headerName) {\r
11036                         return this.headers[i].index;\r
11037                     }\r
11038                 }\r
11039                 return null;\r
11040             };\r
11041             this.sortData = function(columnIndex, reverse) {\r
11042                 $scope.$parent.columnIndex = columnIndex;\r
11043                 $scope.$parent.reverse = reverse;\r
11044                 this.currentSortIndex = columnIndex;\r
11045                 $scope.currentPage = 1;\r
11046                 this.resetSortPattern();\r
11047             };\r
11048             this.getSearchString = function() {\r
11049                 return $scope.searchString;\r
11050             };\r
11051             this.resetSortPattern = function() {\r
11052                 for(var i = 0; i < this.headers.length; i++) {\r
11053                     var currentScope = this.headers[i];\r
11054                     if(currentScope.index !== this.currentSortIndex) {\r
11055                         currentScope.resetSortPattern();\r
11056                     }\r
11057                 }\r
11058             };\r
11059         }],\r
11060         link: function(scope, elem, attr, ctrl) {\r
11061             scope.searchCriteria = {};\r
11062             scope.$watchCollection('tableData', function(value) {\r
11063                 if(value && !isNaN(value.length)) {\r
11064                     scope.totalRows = value.length;\r
11065                 }\r
11066             });\r
11067             scope.$watch('currentPage', function(val) {\r
11068                 scope.$parent.currentPage = val;\r
11069             });\r
11070             scope.$watch('viewPerPage', function(val) {\r
11071                 scope.$parent.viewPerPage = val;\r
11072             });\r
11073             scope.$watch(function() {\r
11074                 return scope.totalRows / scope.viewPerPage;\r
11075             }, function(value) {\r
11076                 if(!isNaN(value)) {\r
11077                     scope.totalPage = Math.ceil(value);\r
11078                     scope.currentPage = 1;\r
11079                 }\r
11080             });\r
11081             var searchValCheck = function(val){\r
11082                 if(angular.isDefined(val) && val !== null && val !== ""){\r
11083                     return true;\r
11084                 }\r
11085             };\r
11086             var setSearchCriteria = function(v1,v2){\r
11087                 if(searchValCheck(v1) && searchValCheck(v2)){\r
11088                     var index = ctrl.getIndex(v2);\r
11089                     scope.searchCriteria = {};\r
11090                     if (index !== null) {\r
11091                         scope.searchCriteria[index] = v1;\r
11092                     }\r
11093                 }else if(searchValCheck(v1) && (!angular.isDefined(v2) || v2 === null || v2 === "")){\r
11094                     scope.searchCriteria = {\r
11095                         $: v1\r
11096                     };\r
11097                 }else {\r
11098                     scope.searchCriteria = {};\r
11099                 }\r
11100             };\r
11101             scope.$watch('searchCategory', function(newVal,oldVal) {\r
11102                 if(newVal !== oldVal){\r
11103                     setSearchCriteria(scope.searchString,newVal);\r
11104                 }\r
11105             });\r
11106             scope.$watch('searchString', function (newVal,oldVal) {\r
11107                 if(newVal !== oldVal){\r
11108                     setSearchCriteria(newVal,scope.searchCategory);\r
11109                 }\r
11110             });\r
11111             scope.$watchCollection('searchCriteria', function(val) {\r
11112                 scope.$parent.searchCriteria = val;\r
11113                 scope.totalRows = scope.tableData && ($filter('filter')(scope.tableData, val, false)).length || 0;\r
11114                 scope.currentPage = 1;\r
11115             });\r
11116         }\r
11117     };\r
11118 }])\r
11119 \r
11120 .directive('attTableRow', [function() {\r
11121     return {\r
11122         restrict: 'EA',\r
11123         compile: function (elem, attr) {\r
11124             if (attr.type === 'header') {\r
11125                 elem.find('tr').eq(0).addClass('tablesorter-headerRow');\r
11126             } else if (attr.type === 'body') {\r
11127                 var html = elem.children();\r
11128                 if(attr.rowRepeat){\r
11129                     if (attr.trackBy) {\r
11130                         html.attr('ng-repeat', attr.rowRepeat.concat(" | orderBy : columnIndex : reverse | filter : searchCriteria : false | attLimitTo : viewPerPage : viewPerPage*(currentPage-1) track by " + attr.trackBy));\r
11131                     } else {\r
11132                         html.attr('ng-repeat', attr.rowRepeat.concat(" | orderBy : columnIndex : reverse | filter : searchCriteria : false | attLimitTo : viewPerPage : viewPerPage*(currentPage-1) track by $index"));\r
11133                     }\r
11134                 }\r
11135                 html.attr('ng-class', "{'alt-row': $even,'normal-row': $odd}");\r
11136                 elem.append(html);\r
11137             }\r
11138         }\r
11139     };\r
11140 }])\r
11141 \r
11142 .directive('attTableHeader', ['tableConfig', function(tableConfig) { \r
11143     return { \r
11144         restrict: 'EA', \r
11145         replace: true, \r
11146         transclude: true, \r
11147         scope: { \r
11148             sortable: '@', \r
11149             defaultSort: '@', \r
11150             index: '@key' \r
11151         }, \r
11152         require: '^attTable', \r
11153         templateUrl: 'app/scripts/ng_js_att_tpls/table/attTableHeader.html', \r
11154         link: function(scope, elem, attr, ctrl) { \r
11155             var reverse = tableConfig.defaultSortPattern; \r
11156             scope.headerName = elem.text(); \r
11157             scope.sortPattern = null; \r
11158             ctrl.setIndex(scope); \r
11159  \r
11160             scope.$watch(function() { \r
11161                 return elem.text(); \r
11162             }, function(value) { \r
11163                 scope.headerName = value; \r
11164             }); \r
11165             scope.sort = function(sortType) { \r
11166                 if(typeof sortType === 'boolean') { \r
11167                     reverse = sortType; \r
11168                 } \r
11169                 ctrl.sortData(scope.index, reverse); \r
11170                 scope.sortPattern = reverse ? 'descending' : 'ascending'; \r
11171                 reverse = !reverse; \r
11172             }; \r
11173             scope.$watch(function() { \r
11174                 return ctrl.currentSortIndex; \r
11175             }, function(value) { \r
11176                 if (value !== scope.index) { \r
11177                     scope.sortPattern = null; \r
11178                 } \r
11179             }); \r
11180  \r
11181             if (scope.sortable === undefined || scope.sortable === 'true' || scope.sortable === true) { \r
11182                 scope.sortable = 'true'; \r
11183             } else if (scope.sortable === false || scope.sortable === 'false') { \r
11184                 scope.sortable = 'false'; \r
11185             } \r
11186  \r
11187             if(scope.sortable !== 'false') { \r
11188                 if(scope.defaultSort === 'A' || scope.defaultSort === 'a') { \r
11189                     scope.sort(false); \r
11190                 } else if(scope.defaultSort === 'D' || scope.defaultSort === 'd') { \r
11191                     scope.sort(true); \r
11192                 } \r
11193             } \r
11194             scope.resetSortPattern = function() { \r
11195                 reverse = tableConfig.defaultSortPattern; \r
11196             }; \r
11197         } \r
11198     }; \r
11199 }])\r
11200 \r
11201 .directive('attTableBody', ['$filter', '$timeout', 'tableConfig', function($filter, $timeout, tableConfig) {\r
11202     return {\r
11203         restrict: 'EA',\r
11204         require: '^attTable',\r
11205         replace: true,\r
11206         transclude: true,\r
11207         templateUrl: 'app/scripts/ng_js_att_tpls/table/attTableBody.html',\r
11208         link: function (scope, elem, attr, ctrl) {\r
11209             var highlightSearchStringClass = tableConfig.highlightSearchStringClass;\r
11210             var searchString = "";\r
11211             var wrapElement = function (elem) {\r
11212                 var text = elem.text();\r
11213                 elem.html($filter('highlight')(text, searchString, highlightSearchStringClass));\r
11214             };\r
11215             var traverse = function (elem) {\r
11216                 var innerHtml = elem.children();\r
11217                 if (innerHtml.length > 0) {\r
11218                     for (var i = 0; i < innerHtml.length; i++) {\r
11219                         traverse(innerHtml.eq(i));\r
11220                     }\r
11221                 } else {\r
11222                     wrapElement(elem);\r
11223                     return;\r
11224                 }\r
11225             };\r
11226             var clearWrap = function (elem) {\r
11227                 var elems = elem.find('*');\r
11228                 for (var i = 0; i < elems.length; i++) {\r
11229                     if (elems.eq(i).attr('class') && elems.eq(i).attr('class').indexOf(highlightSearchStringClass) !== -1) {\r
11230                         var text = elems.eq(i).text();\r
11231                         elems.eq(i).replaceWith(text);\r
11232                     }\r
11233                 }\r
11234             };\r
11235             $timeout(function () {\r
11236                 var actualHtml = elem.children();\r
11237                 scope.$watch(function () {\r
11238                     return ctrl.getSearchString();\r
11239                 }, function (val) {\r
11240                     searchString = val;\r
11241                     clearWrap(elem);\r
11242                     if (actualHtml.length > 0) {\r
11243                         traverse(elem);\r
11244                     } else {\r
11245                         wrapElement(elem);\r
11246                     }\r
11247                 });\r
11248             }, 50);\r
11249         }\r
11250     };\r
11251 }]);\r
11252 \r
11253 angular.module('att.abs.tableMessages', ['att.abs.utilities'])\r
11254     .constant('messageConstants', {\r
11255             TABLE_MESSAGE_TYPES: {\r
11256                 noMatching: 1,\r
11257                 errorLoading: 2,\r
11258                 magnifySearch: 3,\r
11259                 isLoading: 4},\r
11260         USER_MESSAGE_TYPES: {\r
11261             success: 1,\r
11262             error: 0\r
11263             }\r
11264         })\r
11265         .directive('attTableMessage', ['messageConstants', function(messageConstants) {\r
11266                 return {\r
11267                     restrict: 'AE',\r
11268                     replace: true,\r
11269                     transclude: true,\r
11270                     scope: {\r
11271                         msgType: '=',\r
11272                         onRefreshClick: '&'\r
11273                     },\r
11274                     templateUrl: 'app/scripts/ng_js_att_tpls/tableMessages/attTableMessage.html',\r
11275                     link: function(scope) {\r
11276                         scope.messageConstants = messageConstants;\r
11277                         scope.refreshAction = function(evt) {\r
11278                             scope.onRefreshClick(evt);\r
11279                         };\r
11280                     }\r
11281                 };\r
11282         }]).directive('attUserMessage', ['messageConstants', '$timeout', 'DOMHelper', function(messageConstants, $timeout, DOMHelper) {\r
11283             return {\r
11284                 restrict: 'AE',\r
11285                 replace: true,\r
11286                 transclude: true,\r
11287                 scope: {\r
11288                     thetitle: '=',\r
11289                     type: '=',\r
11290                     message: '=',\r
11291                     trigger: '='\r
11292                 },\r
11293                 templateUrl: 'app/scripts/ng_js_att_tpls/tableMessages/attUserMessage.html',\r
11294                 link: function(scope, element) {\r
11295                     var prevActiveElement = undefined;\r
11296                     var firstElement = undefined;\r
11297                     scope.messageConstants = messageConstants;\r
11298 \r
11299                     $timeout(function() {\r
11300                         firstElement = DOMHelper.firstTabableElement(element[0]);\r
11301                     }, 10);\r
11302 \r
11303                     \r
11304                     scope.$watch('trigger', function() {\r
11305                         if (scope.trigger) {\r
11306                             prevActiveElement = document.activeElement;\r
11307                             if (angular.isDefined(firstElement)) {\r
11308                                 firstElement.focus();\r
11309                             }\r
11310                         } else {\r
11311                             if (angular.isDefined(prevActiveElement)) {\r
11312                                 prevActiveElement.focus();\r
11313                             }\r
11314                         }\r
11315                     })\r
11316 \r
11317                     \r
11318                 }\r
11319             };\r
11320     }]);\r
11321 angular.module('att.abs.tabs', ['att.abs.utilities'])\r
11322     .directive('attTabs', function () {\r
11323         return{\r
11324             restrict: 'EA',\r
11325             transclude: false,\r
11326             replace: true,\r
11327             scope: {\r
11328                 tabs: "=title"\r
11329             },\r
11330             controller: ['$scope', function ($scope) {\r
11331                 this.getData = function () {\r
11332                     return $scope.tabs;\r
11333                 };\r
11334                 this.onClickTab = function (tab) {\r
11335                     $scope.currentTab = tab.url;\r
11336                     return $scope.currentTab;\r
11337                 };\r
11338                 this.isActiveTab = function (tab) {\r
11339                     return (tab === $scope.currentTab);\r
11340                 };\r
11341             }],\r
11342             link: function (scope) {\r
11343                 for (var i = 0; i < scope.tabs.length; i++) {\r
11344                     if ((scope.tabs[i].selected) && (scope.tabs[i].url)) {\r
11345                         scope.currentTab = scope.tabs[i].url;\r
11346                     }\r
11347                 }\r
11348             }\r
11349         };\r
11350     })\r
11351     .directive('floatingTabs', function () {\r
11352         return {\r
11353             require: '^attTabs',\r
11354             restrict: 'EA',\r
11355             transclude: false,\r
11356             replace: true,\r
11357             scope: {\r
11358                 size: "@"\r
11359             },\r
11360             templateUrl: 'app/scripts/ng_js_att_tpls/tabs/floatingTabs.html',\r
11361             link: function (scope, elem, attr, attTabsCtrl) {\r
11362                 scope.tabs = attTabsCtrl.getData();\r
11363                 scope.onClickTab = attTabsCtrl.onClickTab;\r
11364                 scope.isActiveTab = attTabsCtrl.isActiveTab;\r
11365             }\r
11366         };\r
11367     })\r
11368     .directive('simplifiedTabs', function () {\r
11369         return {\r
11370             require: '^attTabs',\r
11371             restrict: 'EA',\r
11372             transclude: false,\r
11373             replace: true,\r
11374             scope: {\r
11375                 ctab: "=ngModel"\r
11376             },\r
11377             templateUrl: 'app/scripts/ng_js_att_tpls/tabs/simplifiedTabs.html',\r
11378             link: function (scope, elem, attr, attTabsCtrl) {\r
11379                 scope.tabs = attTabsCtrl.getData();\r
11380                 scope.clickTab = function (tab) {\r
11381                     scope.ctab = tab.id;\r
11382                     return scope.ctab;\r
11383                 };\r
11384                 scope.isActive = function (tab) {\r
11385                     return (tab === scope.ctab);\r
11386                 };\r
11387             }\r
11388         };\r
11389     })\r
11390     .directive('genericTabs', function () {\r
11391         return {\r
11392             require: '^attTabs',\r
11393             restrict: 'EA',\r
11394             transclude: false,\r
11395             replace: true,\r
11396             scope: {\r
11397                 ctab: "=ngModel"\r
11398             },\r
11399             templateUrl: 'app/scripts/ng_js_att_tpls/tabs/genericTabs.html',\r
11400             link: function (scope, elem, attr, attTabsCtrl) {\r
11401                 scope.tabs = attTabsCtrl.getData();\r
11402                 scope.clickTab = function (tab) {\r
11403                     scope.ctab = tab.id;\r
11404                     return scope.ctab;\r
11405                 };\r
11406                 scope.isActive = function (tab) {\r
11407                     return (tab === scope.ctab);\r
11408                 };\r
11409             }\r
11410         };\r
11411     })\r
11412     .directive('skipNavigation', function(){\r
11413         return{\r
11414             link: function(scope,elem,attr){\r
11415                 elem.bind('click', function(){\r
11416                     var skiptoBody = angular.element(elem.parent().parent().parent().parent())[0].querySelector('a.skiptoBody');\r
11417                     (angular.element(skiptoBody)).attr('tabindex',-1);\r
11418                     skiptoBody.focus();\r
11419                 });\r
11420 \r
11421             }\r
11422         }\r
11423     })\r
11424     .directive('parentTab', [function () {\r
11425         return {\r
11426             restrict: 'EA',\r
11427             scope: {\r
11428                 menuItems: '=',\r
11429                 activeSubMenu: '=',\r
11430                 activeMenu: '='\r
11431             },\r
11432             controller: ['$scope', function ($scope) {\r
11433                 $scope.megaMenu = $scope.menuItems;\r
11434                 $scope.megaMenuTab;\r
11435                 $scope.megaMenuHoverTab;\r
11436                 this.setMenu = function () {\r
11437                     $scope.menuItems = $scope.megaMenu;\r
11438                     $scope.activeSubMenu.scroll=false;\r
11439                     for (var i = 0; i < $scope.menuItems.length; i++) {\r
11440                         if ($scope.menuItems[i].active) {\r
11441                             $scope.activeMenu = $scope.menuItems[i];\r
11442                         }\r
11443                     }\r
11444                     this.setSubMenuStatus(false);\r
11445                     $scope.$apply();\r
11446                 };\r
11447                 this.setActiveMenu = function () {\r
11448                     if (!($scope.megaMenuTab === undefined || $scope.megaMenuTab === null)) {\r
11449                         $scope.menuItems = [$scope.megaMenuTab];\r
11450                         $scope.megaMenuTab.scroll = true;\r
11451                         $scope.activeMenu = {};\r
11452                         $scope.activeSubMenu = $scope.megaMenuTab;\r
11453                         this.setSubMenuStatus(true);\r
11454                     }\r
11455                     else{\r
11456                         for(var i=0; i<$scope.menuItems.length; i++){\r
11457                             ($scope.menuItems[i].active = false);\r
11458                             if($scope.menuItems[i].subItems)\r
11459                                 for(var j=0; j<$scope.menuItems[i].subItems.length; j++){\r
11460                                     $scope.menuItems[i].subItems[j].active = false;\r
11461                                 };\r
11462                         };\r
11463                         $scope.menuItems=$scope.megaMenu;\r
11464                     }\r
11465                     $scope.$apply();\r
11466                 };\r
11467                 var checkSubMenuStatus = false;\r
11468                 this.setSubMenuStatus = function (value) {\r
11469                     checkSubMenuStatus = value;\r
11470                 };\r
11471                 this.getSubMenuStatus = function () {\r
11472                     return checkSubMenuStatus;\r
11473                 };\r
11474                 this.setActiveMenuTab = function (tab) {\r
11475                     $scope.megaMenuTab = tab;\r
11476                 };\r
11477                 this.setActiveMenuHoverTab = function (tab) {\r
11478                     $scope.megaMenuHoverTab = tab;\r
11479                 };\r
11480                 this.setActiveSubMenuTab = function () {\r
11481                     $scope.megaMenuTab = $scope.megaMenuHoverTab;\r
11482                 };\r
11483                 this.resetMenuTab = function () {\r
11484                     $scope.megaMenuTab = undefined;\r
11485                 };\r
11486                 this.clearSubMenu = function () {\r
11487                     /* Clears Sub-tems when focus shifts from Sub-menu to Mega menu*/\r
11488                     $scope.$evalAsync(function(){\r
11489                         $scope.megaMenuTab = undefined;\r
11490                         $scope.megaMenuHoverTab = undefined;\r
11491                     })\r
11492                 };\r
11493             }]\r
11494         };\r
11495     }])\r
11496     .directive('parentmenuTabs', [function () {\r
11497         return {\r
11498             restrict: 'EA',\r
11499             transclude: true,\r
11500             replace: true,\r
11501             scope: {\r
11502                 megaMenu: '@',\r
11503                 menuItems: '='\r
11504             },\r
11505             controller: ['$scope', function ($scope) {\r
11506                 this.getMenu = function () {\r
11507                     return $scope.menuItems;\r
11508                 };\r
11509                 this.setMenu = function (menuItem) {\r
11510                     $scope.menuItems = menuItem;\r
11511                 };\r
11512             }],\r
11513             templateUrl: 'app/scripts/ng_js_att_tpls/tabs/parentmenuTab.html'\r
11514         };\r
11515     }])\r
11516 \r
11517     .directive('menuTabs', ["$window", "$document",'events','keymap', function (win, $document, events, keymap) {\r
11518         return {\r
11519             restrict: 'EA',\r
11520             transclude: true,\r
11521             replace: true,\r
11522             require: ['^?parentTab', '^?parentmenuTabs'],\r
11523             scope: {\r
11524                 activeMenu: "=",\r
11525                 menuItem: "=",\r
11526                 subMenu: "@",\r
11527                 subItemActive: "@",\r
11528                 tabName: "=?",\r
11529                 tabUrl: "=?"\r
11530             },\r
11531             templateUrl: function (element, attrs) {\r
11532                 if (attrs.megaMenu) {\r
11533                     return 'app/scripts/ng_js_att_tpls/tabs/menuTab.html';\r
11534                 }\r
11535                 else {\r
11536                     return 'app/scripts/ng_js_att_tpls/tabs/submenuTab.html';\r
11537                 }\r
11538             },\r
11539             link: function (scope, elem, attr, ctrl) {\r
11540                 var parentCtrl = ctrl[0];\r
11541                 var parentmenuCtrl = ctrl[1];\r
11542                 scope.clickInactive = true;\r
11543                 scope.showHoverChild = function (e) {\r
11544                     scope.clickInactive = false;\r
11545                     scope.hoverChild = ctrl[0].getSubMenuStatus();\r
11546                     if (e.type === "mouseover" && ctrl[0].getSubMenuStatus())\r
11547                     {\r
11548                         //scope.showChildren(e);\r
11549                     }\r
11550                     \r
11551                 };\r
11552                 scope.showChildren = function (e) {\r
11553                     scope.parentMenuItems = parentmenuCtrl.getMenu();\r
11554                     for (var i = 0; i < scope.parentMenuItems.length; i++) {\r
11555                         scope.parentMenuItems[i].active = false;\r
11556                         if (scope.parentMenuItems[i].subItems) {\r
11557                             for (var j = 0; j < scope.parentMenuItems[i].subItems.length; j++) {\r
11558                                 scope.parentMenuItems[i].subItems[j].active = false;\r
11559                             }\r
11560                         }\r
11561                         scope.clickInactive = true;\r
11562                     }\r
11563                     scope.menuItem.active = true;\r
11564                     scope.activeMenu = scope.menuItem;\r
11565                     e.stopPropagation();\r
11566                 };\r
11567                 scope.$watch("subItemActive", function (value) {\r
11568                     if (value === "true" && scope.subMenu === 'true') {\r
11569                         parentCtrl.setActiveMenuHoverTab(scope.menuItem);\r
11570                     }\r
11571                 });\r
11572                 scope.showMenuClick = function (e) {\r
11573                     parentCtrl.setActiveMenuTab(scope.menuItem);\r
11574                     e.stopPropagation();\r
11575                 };\r
11576                 scope.showSubMenuClick = function (e) {\r
11577                     parentCtrl.setActiveSubMenuTab();\r
11578                     e.stopPropagation();\r
11579                 };\r
11580                 scope.resetMenu = function (e) {\r
11581                     parentCtrl.resetMenuTab();\r
11582                     e.stopPropagation();\r
11583                 };\r
11584                 function debounce(method, delay) {\r
11585                     clearTimeout(method._tId);\r
11586                     method._tId = setTimeout(function () {\r
11587                         parentCtrl.setMenu();\r
11588                     }, delay);\r
11589                 }\r
11590                 function debounce1(method, delay) {\r
11591                     clearTimeout(method._tId);\r
11592                     method._tId = setTimeout(function () {\r
11593                         parentCtrl.setActiveMenu();\r
11594                     }, delay);\r
11595                 }\r
11596                 $document.bind('scroll', function () {\r
11597                    /* if (win.pageYOffset === 0) {\r
11598                         debounce(parentCtrl.setMenu, 100);\r
11599                     }\r
11600                     else if (win.pageYOffset > 1 && win.pageYOffset < 1500) {\r
11601                         debounce1(parentCtrl.setActiveMenu, 100);\r
11602                     }*/\r
11603                 });\r
11604                 elem.bind('keydown', function(evt){\r
11605                     if (!(evt.keyCode)){\r
11606                         evt.keyCode = evt.which;\r
11607                     }\r
11608                     if(evt.keyCode !== keymap.KEY.TAB){\r
11609                         events.preventDefault(evt);\r
11610                         events.stopPropagation(evt);\r
11611                     }\r
11612 \r
11613                     switch (evt.keyCode) {\r
11614                         case keymap.KEY.ESC:\r
11615                             var skiptoBody;\r
11616                             if (!(elem.attr('mega-menu'))) {\r
11617                                 if (elem.attr("sub-menu") === "true") {\r
11618                                     /* condition true when user navigates through Sub-menu*/\r
11619 \r
11620                                     skiptoBody = angular.element(elem.parent().parent().parent().parent().parent().parent().parent())[0].querySelector('a.skiptoBody');\r
11621                                     (angular.element(skiptoBody)).attr('tabindex',-1);\r
11622                                     skiptoBody.focus();\r
11623                                 }\r
11624                                 else if (elem.attr("sub-menu") === undefined) {\r
11625                                     skiptoBody = angular.element(elem.parent().parent().parent().parent().parent().parent().parent().parent().parent().parent())[0].querySelector('a.skiptoBody');\r
11626                                     (angular.element(skiptoBody)).attr('tabindex',-1);\r
11627                                     skiptoBody.focus();\r
11628                                 }\r
11629                             }\r
11630                             else\r
11631                             {\r
11632                                 if (elem.attr("menu-item") === "item") {\r
11633                                     /* Works when user on Mega menu*/\r
11634 \r
11635                                     skiptoBody = angular.element(elem.parent().parent().parent().parent())[0].querySelector('a.skiptoBody');\r
11636                                     (angular.element(skiptoBody)).attr('tabindex',-1);\r
11637                                     skiptoBody.focus();\r
11638                                 }\r
11639                             }\r
11640                             break;\r
11641                         case keymap.KEY.RIGHT:\r
11642                             if (!(elem.attr('mega-menu'))) {\r
11643                                  var el = angular.element(elem)[0];\r
11644                                 if (elem.attr("sub-menu") === "true") {\r
11645                                     /* condition true when user navigates through Sub-menu*/\r
11646                                     if(el.nextElementSibling === null){ break;}\r
11647                                     if(el.nextElementSibling){\r
11648                                         el.nextElementSibling.querySelector("a").focus();\r
11649                                     }\r
11650                                     else{\r
11651                                         do{\r
11652                                             if (el && el.nextSibling){\r
11653                                                 el = el.nextSibling;\r
11654                                             }\r
11655                                             else{\r
11656                                                 break;\r
11657                                             }\r
11658                                         } while (el && el.tagName !== 'LI');\r
11659                                         if(el){\r
11660                                             if (el.querySelector("a") == null){}\r
11661                                             else{\r
11662                                             el.querySelector("a").focus();}\r
11663                                         }\r
11664                                         events.preventDefault(evt);\r
11665                                         events.stopPropagation(evt);\r
11666                                     }\r
11667                                 }\r
11668                                 else if (elem.attr("sub-menu") === undefined) {\r
11669                                     if(el.nextElementSibling === null) break;\r
11670                                     if(el.nextElementSibling){\r
11671                                         el.nextElementSibling.querySelector("a").focus();\r
11672                                     }\r
11673                                     else{\r
11674                                         do{\r
11675                                             if (el && el.nextSibling){\r
11676                                                 el = el.nextSibling;\r
11677                                             }\r
11678                                             else{\r
11679                                                 break;\r
11680                                             }\r
11681                                         } while (el && el.tagName !== 'LI');\r
11682                                         if(el){\r
11683                                             if (el.querySelector("a") == null){}\r
11684                                             else{\r
11685                                             el.querySelector("a").focus();}\r
11686                                         }\r
11687 \r
11688                                     }\r
11689                                 }\r
11690                             }\r
11691                             else\r
11692                             {\r
11693                                 if (elem.attr("menu-item") === "item") {\r
11694                                     /* When user navigates through on Mega menu*/\r
11695 \r
11696                                     var el = angular.element(elem)[0];\r
11697 \r
11698                                         if(el.nextElementSibling){\r
11699                                             if(el.nextElementSibling.querySelector("span") == null){\r
11700                                             }\r
11701                                             else {\r
11702                                                 el.nextElementSibling.querySelector("span").focus();\r
11703                                             }\r
11704                                     }\r
11705                                     else{\r
11706                                         do{\r
11707                                             if (el && el.nextSibling){\r
11708                                                 el = el.nextSibling;\r
11709                                             }\r
11710                                             else{\r
11711                                                 break;\r
11712                                             }\r
11713                                         } while (el && el.tagName !== 'LI');\r
11714                                         if(el){\r
11715                                             if(el.querySelector("span") === null){}\r
11716                                             else {\r
11717                                                 el.querySelector("span").focus();\r
11718                                             }\r
11719                                         }\r
11720                                         events.preventDefault(evt);\r
11721                                         events.stopPropagation(evt);\r
11722                                     }\r
11723                                 }\r
11724                             }\r
11725                             break;\r
11726                         case keymap.KEY.DOWN:\r
11727 \r
11728 \r
11729                             if (elem.attr('mega-menu')) {\r
11730                                 /* When user navigates from top menu to Sub-menu*/\r
11731                                 angular.element(elem)[0].querySelectorAll(".megamenu__items")[0].querySelector("a").focus();\r
11732                             }\r
11733                             else if(elem.attr("sub-menu") === undefined) {\r
11734                             /*When user navigates within Sub Items*/\r
11735                                 var el = document.activeElement;\r
11736                                 if(el.nextElementSibling === null) break;\r
11737                                  if(el.nextElementSibling) {\r
11738                                     el.nextElementSibling.focus();\r
11739                                 }else{\r
11740                                      do {\r
11741                                          if (el && el.nextSibling){\r
11742                                              el = el.nextSibling;\r
11743                                          }\r
11744                                          else{\r
11745                                              break;\r
11746                                          }\r
11747                                      } while (el && el.tagName !== 'A');\r
11748                                      if(el.attributes !== null){                                        \r
11749                                          el.focus();\r
11750                                      }\r
11751                                      events.stopPropagation(evt);\r
11752                                  }\r
11753 \r
11754                             }\r
11755                             else if (elem.attr("sub-menu")=== "true" ) {\r
11756                                 /* condition true when user navigates from sub menu to  Sub Item*/\r
11757                                 var childItems = angular.element(elem)[0].querySelector("span").querySelector('a');\r
11758                                 if(childItems === null) break;\r
11759                                 childItems.focus();\r
11760                             }\r
11761                             break;\r
11762 \r
11763                         case keymap.KEY.LEFT:\r
11764 \r
11765                             if (!(elem.attr('mega-menu'))) {\r
11766                                 var el = angular.element(elem)[0];\r
11767                                 if (elem.attr("sub-menu") === "true") {\r
11768                                     /* condition true when user navigates through Sub-menu*/\r
11769                                     if(el.previousElementSibling === null) break;\r
11770                                     if(el.previousElementSibling){\r
11771                                         el.previousElementSibling.querySelector("a").focus();\r
11772                                     }\r
11773                                     else{\r
11774                                         do{\r
11775                                             if (el && el.previousSibling){\r
11776                                                 el = el.previousSibling;\r
11777                                             }\r
11778                                             else{\r
11779                                                 break;\r
11780                                             }\r
11781                                         } while (el && el.tagName !== 'LI');\r
11782                                         if(el){\r
11783                                             if (el.querySelector("a") == null){}\r
11784                                             else{\r
11785                                             el.querySelector("a").focus();}\r
11786                                         }\r
11787                                         events.preventDefault(evt);\r
11788                                         events.stopPropagation(evt);\r
11789                                     }\r
11790 \r
11791                                     /*el.previousElementSibling.querySelector("span").focus();\r
11792                                     events.stopPropagation(evt);\r
11793                                     break;*/\r
11794                                 }\r
11795                                 else if (elem.attr("sub-menu") === undefined) {\r
11796                                     if(el.previousElementSibling === null) break;\r
11797                                     if(el.previousElementSibling){\r
11798                                         el.previousElementSibling.querySelector("a").focus();\r
11799                                     }\r
11800                                     else{\r
11801                                         do{\r
11802                                             if (el && el.previousSibling){\r
11803                                                 el = el.previousSibling;\r
11804                                             }\r
11805                                             else{\r
11806                                                 break;\r
11807                                             }\r
11808                                         } while (el && el.tagName !== 'LI');\r
11809                                         if(el){\r
11810                                             if (el.querySelector("a") == null){}\r
11811                                             else{\r
11812                                             el.querySelector("a").focus();}\r
11813                                         }\r
11814                                     }\r
11815                                 }\r
11816                             }\r
11817                             else\r
11818                             {\r
11819                                 if (elem.attr("menu-item") === "item") {\r
11820                                     /* Works when user on Mega menu*/\r
11821 \r
11822                                     var el = angular.element(elem)[0];\r
11823                                         if(el.previousElementSibling){\r
11824 \r
11825                                             if(el.previousElementSibling.querySelector("span") === null){\r
11826                                             }\r
11827                                             else {\r
11828                                                 el.previousElementSibling.querySelector("span").focus();\r
11829                                             }\r
11830                                       \r
11831                                     }\r
11832                                     else{\r
11833                                         do{\r
11834                                             if (el && el.previousSibling){\r
11835                                                 el = el.previousSibling;\r
11836                                             }\r
11837                                             else{\r
11838                                                 break;\r
11839                                             }\r
11840                                         } while (el && el.tagName !== 'LI');\r
11841                                         if(el){\r
11842                                             if (el.querySelector("span") === null) {\r
11843                                             }\r
11844                                             else {\r
11845                                             el.querySelector("span").focus();\r
11846                                             }\r
11847                                         }\r
11848                                         events.preventDefault(evt);\r
11849                                         events.stopPropagation(evt);\r
11850                                     }\r
11851                                 }\r
11852                             }\r
11853                             break;\r
11854                         case keymap.KEY.UP:\r
11855 \r
11856                             if (elem.attr("sub-menu") === "true") {\r
11857                                 var el = document.activeElement;\r
11858                                 var parent_menu = angular.element(elem.parent().parent().parent().parent())[0].querySelector("span");\r
11859                                 parent_menu.focus();\r
11860                                 parentCtrl.clearSubMenu();\r
11861                                 scope.menuItem.active = false;\r
11862                                 break;\r
11863                             }\r
11864                             else if(elem.attr("sub-menu") === undefined) {\r
11865                                 /* condition true when user navigates within Sub Items*/\r
11866                                 var el = document.activeElement;\r
11867                                 var parent_menu = angular.element(elem.parent().parent().parent().parent())[0].querySelector("a");                                \r
11868                                 if(document.activeElement === angular.element(el).parent().parent()[0].querySelectorAll('a')[0]){\r
11869                                     parent_menu.focus();\r
11870                                     break;\r
11871                                 };\r
11872 \r
11873                                 if(el.previousElementSibling) {\r
11874                                     var prev_a =  el.previousElementSibling;\r
11875                                     (el.previousElementSibling != null)? el.previousElementSibling.focus(): parent_menu.focus();\r
11876                                 }else{\r
11877                                     do{\r
11878                                         if (el && el.previousSibling){\r
11879                                             el = el.previousSibling;\r
11880                                         }\r
11881                                         else{\r
11882                                             break;\r
11883                                         }\r
11884                                     } while (el && el.tagName !== 'A');\r
11885                                     if(el && (el.nodeType !== 3)){\r
11886                                         el.focus();\r
11887                                     }\r
11888                                     events.preventDefault(evt);\r
11889                                     events.stopPropagation(evt);\r
11890                                 }\r
11891 \r
11892                                 break;\r
11893                             }\r
11894                         default:\r
11895                             break;\r
11896                     }\r
11897                 });\r
11898             }\r
11899         };\r
11900     }]);\r
11901 \r
11902 angular.module('att.abs.tagBadges', [])\r
11903         .directive('tagBadges', ['$parse', '$timeout', function($parse, $timeout) {\r
11904                 return {\r
11905                     restrict: 'EA',\r
11906                     replace: false,\r
11907                     transclude: true,\r
11908                     templateUrl: 'app/scripts/ng_js_att_tpls/tagBadges/tagBadges.html',\r
11909                     scope: {\r
11910                         styleType: "@",\r
11911                         onClose: "&"\r
11912                     },\r
11913                     link: function(scope, elem, attr) {\r
11914                         scope.isSmall = false;\r
11915                         scope.isIcon = false;\r
11916                         scope.isColor = false;\r
11917                         scope.display = true;\r
11918                         scope.isClosable = false;\r
11919                         scope.isHighlight = false;\r
11920                         scope.customColor = false;\r
11921 \r
11922                         if (attr.small === "") {\r
11923                             scope.isSmall = true;\r
11924                         }\r
11925                         if (scope.styleType === "icon") {\r
11926                             scope.isIcon = true;\r
11927                         }\r
11928                         else if (scope.styleType === "color") {\r
11929                             scope.isColor = true;\r
11930                             if(attr.color !== undefined && attr.color !== "") {\r
11931                                 scope.customColor = true;\r
11932                                 attr.$observe("color", function(val) {\r
11933                                     scope.border_type_borderColor = val;\r
11934                                     scope.background_type_backgroundColor = val;\r
11935                                     scope.background_type_borderColor = val;\r
11936                                 });\r
11937                             }\r
11938                         }\r
11939                         scope.activeHighlight = function(state){\r
11940                             if(scope.customColor){\r
11941                                 if(state){\r
11942                                     scope.isHighlight = true;\r
11943                                 }\r
11944                                 else{\r
11945                                     scope.isHighlight = false;\r
11946                                 }\r
11947                             }\r
11948                         };\r
11949                         if (attr.closable === "") {\r
11950                             scope.isClosable = true;\r
11951                             scope.closeMe = function() {\r
11952                                 scope.display = false;\r
11953                                 $timeout(function(){\r
11954                                     elem.attr("tabindex", "0");\r
11955                                     elem[0].focus();\r
11956                                     elem.bind('blur', function(){\r
11957                                         elem.remove();\r
11958                                     });\r
11959                                 });\r
11960                                 if(attr['onClose']){\r
11961                                     scope.onClose = $parse(scope.onClose);\r
11962                                     scope.onClose();\r
11963                                 }\r
11964                             };\r
11965                         }\r
11966                     }\r
11967                 };\r
11968             }]);\r
11969 angular.module('att.abs.textOverflow', [])\r
11970         .constant('textDefaultOptions', {\r
11971             width: '50%'\r
11972         })\r
11973 .directive('attTextOverflow', ['textDefaultOptions','$compile',function(textDefaultOptions,$compile)\r
11974 {\r
11975     return {\r
11976         restrict: 'A',\r
11977         link: function(scope, elem, attrs)\r
11978         {\r
11979             var tooltipText = elem.text();\r
11980             elem.addClass('text-ellipsis');\r
11981             attrs.$observe('attTextOverflow', function(val){\r
11982                 if(val){\r
11983                     elem.css({"width":val});\r
11984                 }\r
11985                 else{\r
11986                     elem.css({"width":textDefaultOptions.width});\r
11987                 }\r
11988             });\r
11989             if(!(elem.attr('tooltip'))){\r
11990                 elem.attr("tooltip", tooltipText);\r
11991                 elem.attr("tooltip-placement", 'above');\r
11992                 var newElem =  angular.element(elem);\r
11993                 $compile(newElem)(scope);\r
11994             }\r
11995         }\r
11996     };\r
11997 }]);\r
11998 \r
11999 angular.module('att.abs.toggle', ['angular-gestures', 'att.abs.position'])\r
12000         .directive('attToggleTemplate', ['$compile', '$log', '$position', function ($compile, $log, $position)\r
12001             {\r
12002                 return{\r
12003                     restrict: 'A',\r
12004                     require: 'ngModel',\r
12005                     transclude: true,\r
12006                     scope: {\r
12007                         modelVal: "=ngModel"\r
12008                     },\r
12009                     templateUrl: 'app/scripts/ng_js_att_tpls/toggle/demoToggle.html',\r
12010                     link: function (scope, element, attr) {\r
12011                         scope.initialDragPosition = 0;\r
12012                         var dragStatus = 0;\r
12013                         var switchMovementPath = ($position.offset(element.children().eq(1).children().eq(0)).width - 1);\r
12014                         var updateModelVal = function () {\r
12015                             if (scope.attrValue === attr.ngTrueValue || scope.attrValue)\r
12016                             {\r
12017                                 scope.modelVal = false;\r
12018                             }\r
12019                             else\r
12020                             {\r
12021                                 scope.modelVal = true;\r
12022                             }\r
12023                         };\r
12024                         scope.updateModel = function (env) {\r
12025                             {\r
12026                                 if (dragStatus !== 1) {\r
12027                                     updateModelVal();\r
12028                                     dragStatus = 0;\r
12029                                 }\r
12030                             }\r
12031                             env.preventDefault();\r
12032                         };\r
12033                         scope.drag = function (e) {\r
12034                             dragStatus = 1;\r
12035                             if (e.type === 'dragstart') {\r
12036                                 scope.initialDragPosition = $position.position(element.children().eq(1)).left;\r
12037                                 element.children().eq(1).addClass('dragging');\r
12038                             } else if (e.type === 'drag') {\r
12039                                 var left = Math.min(0, Math.max(scope.initialDragPosition + e.gesture.deltaX, -switchMovementPath));\r
12040                                 element.children().eq(1).css({\r
12041                                     left: left + 'px'\r
12042                                 });\r
12043                             } else if (e.type === 'dragend') {\r
12044                                 var isOn = $position.position(element.children().eq(1)).left > (switchMovementPath * -1) / 2;\r
12045                                 element.children().eq(1).removeClass('dragging');\r
12046                                 TweenMax.to(element.children().eq(1), .1, {left: isOn ? 0 : (switchMovementPath * -1), ease: Power4.easeOut,\r
12047                                     onComplete: function () {\r
12048                                         element.children().eq(1).css({left: ''});\r
12049                                     }});\r
12050                                 if (isOn || (!isOn && e.gesture.direction === "left")) {\r
12051                                     updateModelVal();\r
12052                                 }\r
12053                                 dragStatus = 0;\r
12054                             }\r
12055 \r
12056                             return false;\r
12057                         };\r
12058 \r
12059                         scope.directiveValue = attr.attToggleTemplate;\r
12060                         scope.on = attr.trueValue;\r
12061                         scope.off = attr.falseValue;\r
12062                         var switchMovementPathPixels = ((switchMovementPath) * -1) + 'px';\r
12063                         scope.$watch('modelVal', function (newVal) {\r
12064                             scope.attrValue = newVal;\r
12065                             if (newVal === attr.ngTrueValue || newVal) {\r
12066                                 element.children().eq(1).css({\r
12067                                     left: '0px'\r
12068                                 });\r
12069                                 element.addClass('att-checkbox--on');\r
12070                                 var elem = element.find('div').find('div').eq(1);\r
12071                                 elem.attr("aria-checked", true);\r
12072                                 dragStatus = 0;\r
12073                             } else {\r
12074                                 element.children().eq(1).css({\r
12075                                     left: switchMovementPathPixels\r
12076                                 });\r
12077                                 element.removeClass('att-checkbox--on');\r
12078                                  var elem = element.find('div').find('div').eq(1);\r
12079                                 elem.attr("aria-checked", false);\r
12080                                 dragStatus = 0;\r
12081                             }\r
12082                             element.children().eq(1).css({\r
12083                                 left: ''\r
12084                             });\r
12085                         });\r
12086                     }\r
12087                 };\r
12088             }\r
12089         ])\r
12090 \r
12091         .directive('attToggleMain', ['$compile', function ($compile)\r
12092             {\r
12093                 return{\r
12094                     restrict: 'A',\r
12095                     require: 'ngModel',\r
12096                     transclude: true,\r
12097                     replace: true,\r
12098                     scope: {\r
12099                         modelValue: "=ngModel",\r
12100                         trueValue: "=ngTrueValue",\r
12101                         falseValue: "=ngFalseValue"\r
12102                     },\r
12103                     link: function (scope, element, attr) {\r
12104                         var html = "";\r
12105                         var attrVal = "";\r
12106                         element.removeAttr('att-toggle-main');\r
12107                         scope.on = attr.ngTrueValue;\r
12108                         scope.off = attr.ngFalseValue;\r
12109                         scope.largeValue = attr.attToggleMain;\r
12110                         if (angular.isDefined(attr.ngTrueValue)) {\r
12111                             html += ' true-value="{{on}}" false-value="{{off}}"';\r
12112                         }\r
12113                         if (scope.largeValue !== undefined)\r
12114                         {\r
12115                             attrVal += ' ="{{largeValue}}"';\r
12116                         }\r
12117 \r
12118                         element.css({display: 'none'});\r
12119                         var elm = angular.element('<div class="att-switch att-switch-alt" ng-class="{\'large\' : largeValue == \'large\'}" ng-model="modelValue"' + html + ' att-toggle-template' + attrVal + '>' + element.prop('outerHTML') + '</div>');\r
12120                         elm = $compile(elm)(scope);\r
12121                         element.replaceWith(elm);\r
12122                     }\r
12123                 };\r
12124             }]);\r
12125 angular.module('att.abs.treeview', [])\r
12126         .directive('treeView', function() {\r
12127             return{\r
12128                 restrict: 'A',\r
12129                 link: function(scope, elem) {\r
12130                     var el = elem.children('ul li');\r
12131                     var list = TweenMax.from(el, .2, {display: 'none', paused: true, reversed: true});\r
12132                     elem.attr("tabindex","0");\r
12133                     function toggleBranch() {\r
12134                         if (list.reversed())\r
12135                         {\r
12136                             list.play();\r
12137                         } else\r
12138                         {\r
12139                             list.reverse();\r
12140                         }\r
12141                     };\r
12142                     function toggleTree(e) {\r
12143                         e.stopPropagation();\r
12144                         if (angular.element(e.target).attr("tree-view") !== undefined)\r
12145                         {\r
12146                             if (elem.hasClass('minus'))\r
12147                             {\r
12148                                 elem.removeClass('minus');\r
12149                             }\r
12150                             else\r
12151                             {\r
12152                                 elem.addClass('minus');\r
12153                             }\r
12154                             toggleBranch();\r
12155                         }\r
12156                     }\r
12157                     elem.on('click', function(e) {\r
12158                         toggleTree(e);\r
12159                     });\r
12160                     elem.on('keypress', function (e) {\r
12161                         var activeCode = e.keyCode ? e.keyCode : e.charCode;\r
12162                         var keyCode = [13,32];\r
12163                         if (keyCode.length > 0 && ((activeCode && keyCode.indexOf(activeCode) > -1))) {\r
12164                             toggleTree(e);\r
12165                             e.preventDefault();\r
12166                         }\r
12167                     });\r
12168                 }\r
12169             };\r
12170         });\r
12171 \r
12172 angular.module('att.abs.typeAhead', ['att.abs.tagBadges'])\r
12173 \r
12174         .directive('focusMe',['$timeout', '$parse', function($timeout, $parse) {\r
12175             return {\r
12176                 link: function(scope, element, attrs) {\r
12177                     var model = $parse(attrs.focusMe);\r
12178                     scope.$watch(model, function(value) {\r
12179                         if (value) {\r
12180                             $timeout(function() {\r
12181                                 element[0].focus();\r
12182                                 scope.inputActive=true;\r
12183                             });\r
12184                         }\r
12185                     });\r
12186                     element.bind('blur', function() {\r
12187                          model.assign(scope, false);\r
12188                          scope.inputActive=false;\r
12189                          scope.$digest();\r
12190                      });\r
12191                 }\r
12192             };\r
12193         }])\r
12194 \r
12195         .directive('typeAhead', ['$timeout','$log', function($timeout,$log) {\r
12196                 return {\r
12197                     restrict: 'EA',\r
12198                     templateUrl: 'app/scripts/ng_js_att_tpls/typeAhead/typeAhead.html',\r
12199                     replace: true,\r
12200                     scope: {\r
12201                         items: '=',\r
12202                         title: '@?',\r
12203                         titleName: '@',\r
12204                         subtitle: '@',\r
12205                         model: '=',\r
12206                         emailIdList:'=',\r
12207                         emailMessage:'='\r
12208                     },\r
12209                     link: function(scope, elem) {\r
12210                         if(!angular.isDefined(scope.titleName) && angular.isDefined(scope.title)){\r
12211                              $timeout(function(){\r
12212                             scope.titleName = scope.title;\r
12213                             $log.warn("title attribute is deprecated and title-name attribute is used instead as it is conflicting with html title attribute");\r
12214                              });\r
12215                         }\r
12216                         scope.lineItems = [];\r
12217                         scope.filteredListLength = -1;\r
12218                         scope.filteredList = [];\r
12219                         scope.setFocus = function() {\r
12220                         scope.clickFocus = true;\r
12221                         };\r
12222                         scope.setFocus();\r
12223                         scope.handleSelection = function(selectedItem,emailItem) {\r
12224                             scope.lineItems.push(selectedItem);\r
12225                             scope.emailIdList.push(emailItem);\r
12226                             scope.model = "";\r
12227                             scope.current = 0;\r
12228                             scope.selected = true;\r
12229                             scope.clickFocus = true;\r
12230                         };\r
12231                         scope.theMethodToBeCalled = function(index) {\r
12232                             var tempArr = scope.lineItems.slice();\r
12233                             scope.emailIdList.splice(index, 1);\r
12234                             tempArr.splice(index, 1);\r
12235                             $timeout(function() {\r
12236                                 scope.lineItems = [];\r
12237                                 scope.$apply();\r
12238                                 scope.lineItems = scope.lineItems.concat(tempArr);\r
12239                             });\r
12240                         };\r
12241 \r
12242                         scope.current = 0;\r
12243                         scope.selected = true;\r
12244 \r
12245                         scope.isCurrent = function(index, itemName,itemEmail,dropdownLength) {\r
12246                             if (scope.current === index) {\r
12247                                 scope.itemName = itemName;\r
12248                                 scope.itemEmail = itemEmail;\r
12249                             }\r
12250                             scope.dropdownLength=dropdownLength;\r
12251                             return scope.current === index;\r
12252                         };\r
12253 \r
12254                         scope.setCurrent = function(index) {\r
12255                             scope.current = index;\r
12256                         };\r
12257 \r
12258                         scope.selectionIndex = function(evt) {\r
12259                             if (evt.keyCode === 38 && scope.current > 0) {\r
12260                                evt.preventDefault();\r
12261                                 scope.current = scope.current - 1;\r
12262                                 scope.isCurrent(scope.current);\r
12263                             } else if (evt.keyCode === 9) {\r
12264                                 scope.selected = true;\r
12265                             } else if (evt.keyCode === 13 && scope.dropdownLength!==scope.items.length) {\r
12266                                 scope.handleSelection(scope.itemName,scope.itemEmail);\r
12267                             } else if ((evt.keyCode === 8 && scope.model.length === 0) || evt.keyCode === 46) {\r
12268                                 scope.theMethodToBeCalled(scope.lineItems.length - 1);\r
12269                             } else if (evt.keyCode === 40 && scope.current < scope.dropdownLength-1) {\r
12270                                 evt.preventDefault();\r
12271                                 scope.current = scope.current + 1;\r
12272                                 scope.isCurrent(scope.current);\r
12273                             }\r
12274                             elem[0].querySelector('.list-scrollable').scrollTop = (scope.current - 1) * 35;\r
12275                         };\r
12276                     }\r
12277                 };\r
12278             }]);\r
12279 angular.module('att.abs.verticalSteptracker', ['ngSanitize'])\r
12280     .directive('verticalSteptracker', [ function(){\r
12281         return {\r
12282             restrict: 'EA',\r
12283             transclude: true,\r
12284             replace: false,\r
12285             scope: {},\r
12286             template: '<div class="vertical-nav"><ul ng-transclude arial-label="step list" role="presentation" class="tickets-list-height"></ul></div>',\r
12287             link: function () {}\r
12288         };\r
12289     }])\r
12290     .directive('verticalSteptrackerStep',[ function(){\r
12291         return {\r
12292             restrict: 'EA',\r
12293             transclude: true,\r
12294             replace: false,\r
12295             scope: {\r
12296                 type: "=type",\r
12297                 id: "=id"\r
12298             },\r
12299             templateUrl: 'app/scripts/ng_js_att_tpls/verticalSteptracker/vertical-step-tracker.html',\r
12300             link: function(){}\r
12301          };\r
12302     }])\r
12303     .directive('attAbsLink',[ function(){\r
12304         return{\r
12305             restrict: 'EA',\r
12306             transclude: true,\r
12307             replace: false,\r
12308             template: '<span ng-transclude class="view-log"></span>'\r
12309         };\r
12310     }]);\r
12311 angular.module('att.abs.videoControls', [])\r
12312         .config(['$compileProvider' , function ($compileProvider) {\r
12313                 $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|javascript):/);\r
12314             }])\r
12315         .directive('videoControls', [function() {\r
12316                 return {\r
12317                     restrict: 'EA',\r
12318                     replace: true,\r
12319                     transclude: true,\r
12320                     templateUrl: 'app/scripts/ng_js_att_tpls/videoControls/videoControls.html'\r
12321                 };\r
12322             }])\r
12323         .directive('photoControls', [function() {\r
12324                 return {\r
12325                     restrict: 'EA',\r
12326                     replace: true,\r
12327                     transclude: true,\r
12328                     templateUrl: 'app/scripts/ng_js_att_tpls/videoControls/photoControls.html',\r
12329                     scope: {\r
12330                         prevLink: "@",\r
12331                         nextLink: "@"\r
12332                     },\r
12333                     link: function(scope, elem, attr) {\r
12334                         if(!attr['prevLink']){\r
12335                             scope.prevLink = 'javascript:void(0)';\r
12336                         }\r
12337                         if(!attr['nextLink']){\r
12338                             scope.nextLink = 'javascript:void(0)';\r
12339                         }\r
12340                         scope.links = {\r
12341                             prevLink : scope.prevLink,\r
12342                             nextLink : scope.nextLink\r
12343                         };\r
12344                     }\r
12345                 };\r
12346             }]);\r
12347 angular.module("app/scripts/ng_js_att_tpls/accordion/accordion.html", []).run(["$templateCache", function($templateCache) {\r
12348           $templateCache.put("app/scripts/ng_js_att_tpls/accordion/accordion.html",\r
12349             "<div class=\"att-accordion__group tabpanel\" ng-class=\"{'att-accordion__group att-accordion__group--open':isOpen,'att-accordion__group':!isOpen }\">\n" +\r
12350             "    <a  ng-show=\"showicon\" \n" +\r
12351             "        class=\"toggle-header att-accordion__heading att-accordion__toggle noafter\" \n" +\r
12352             "        aria-selected=\"{{focused}}\" \n" +\r
12353             "        aria-controls=\"panel{{index}}\" \n" +\r
12354             "        aria-expanded=\"{{isOpen}}\" \n" +\r
12355             "        ng-class=\"{focus: focused, selected: focused}\"         \n" +\r
12356             "        role=\"tab\" \n" +\r
12357             "        ng-click=\"toggle()\" \n" +\r
12358             "        accordion-transclude=\"heading\" \n" +\r
12359             "        style=\"cursor:pointer; text-decoration:none\">\n" +\r
12360             "        <span href=\"#\"><i class={{headingIconClass}}></i>&nbsp;&nbsp;{{heading}}</span>\n" +\r
12361             "        <i i ng-show = 'childLength > 0' ng-class=\"{'icon-chevron-down':!isOpen,'icon-chevron-up':isOpen }\" class=\"pull-right\"></i>\n" +\r
12362             "    </a>\n" +\r
12363             "    <div ng-show=\"!showicon\" \n" +\r
12364             "         ng-class=\"{focus: focused, selected: focused}\" \n" +\r
12365             "         style=\"text-decoration:none\" \n" +\r
12366             "         accordion-transclude=\"heading\"          \n" +\r
12367             "         role=\"tab\"  \n" +\r
12368             "         aria-expanded=\"{{isOpen}}\"\n" +\r
12369             "         aria-selected=\"{{focused}}\" \n" +\r
12370             "         aria-controls=\"panel{{index}}\" \n" +\r
12371             "         class=\"toggle-header att-accordion__heading att-accordion__toggle noafter\">\n" +\r
12372             "        <span>{{heading}}</span>\n" +\r
12373             "    </div>    \n" +\r
12374             "    <div aria-label=\"{{heading}}\" \n" +\r
12375             "         aria-hidden=\"{{!isOpen}}\" \n" +\r
12376             "         role=\"tabpanel\" \n" +\r
12377             "         collapse=\"!isOpen\" \n" +\r
12378             "         class=\"att-accordion__body\" \n" +\r
12379             "         id=\"panel{{index}}\" \n" +\r
12380             "         ng-transclude>\n" +\r
12381             "    </div>\n" +\r
12382             "    <div class=\"att-accordion__bottom--border\"></div>    \n" +\r
12383             "</div> ");\r
12384 }]);\r
12385 \r
12386 angular.module("app/scripts/ng_js_att_tpls/accordion/accordion_alt.html", []).run(["$templateCache", function($templateCache) {\r
12387   $templateCache.put("app/scripts/ng_js_att_tpls/accordion/accordion_alt.html",\r
12388     "<div class=\"att-accordion__group tabpanel\" ng-class=\"{'att-accordion__group att-accordion__group--open':isOpen,'att-accordion__group':!isOpen }\">\n" +\r
12389     "    <a class=\"toggle-header att-accordion__heading att-accordion__toggle\" \n" +\r
12390     "       aria-selected=\"{{focused}}\" \n" +\r
12391     "       aria-controls=\"panel{{index}}\" \n" +\r
12392     "       ng-class=\"{focus: focused, selected: focused}\" \n" +\r
12393     "       aria-expanded=\"{{isOpen}}\" \n" +\r
12394     "       role=\"tab\" \n" +\r
12395     "       ng-click=\"toggle()\" \n" +\r
12396     "       accordion-transclude=\"heading\">        \n" +\r
12397     "    </a>\n" +\r
12398     "    <span>{{heading}}</span>\n" +\r
12399     "    <div aria-label=\"{{heading}}\" \n" +\r
12400     "         aria-hidden=\"{{!isOpen}}\" \n" +\r
12401     "         role=\"tabpanel\" \n" +\r
12402     "         collapse=\"!isOpen\" \n" +\r
12403     "         class=\"att-accordion__body\" \n" +\r
12404     "         id=\"panel{{index}}\" \n" +\r
12405     "         ng-transclude>\n" +\r
12406     "    </div>\n" +\r
12407     "</div> ");\r
12408 }]);\r
12409 \r
12410 angular.module("app/scripts/ng_js_att_tpls/accordion/attAccord.html", []).run(["$templateCache", function($templateCache) {\r
12411   $templateCache.put("app/scripts/ng_js_att_tpls/accordion/attAccord.html",\r
12412     "<div ng-transclude></div>");\r
12413 }]);\r
12414 \r
12415 angular.module("app/scripts/ng_js_att_tpls/accordion/attAccordBody.html", []).run(["$templateCache", function($templateCache) {\r
12416   $templateCache.put("app/scripts/ng_js_att_tpls/accordion/attAccordBody.html",\r
12417     "<div ng-transclude></div>");\r
12418 }]);\r
12419 \r
12420 angular.module("app/scripts/ng_js_att_tpls/accordion/attAccordHeader.html", []).run(["$templateCache", function($templateCache) {\r
12421   $templateCache.put("app/scripts/ng_js_att_tpls/accordion/attAccordHeader.html",\r
12422     "<div ng-click=\"clickFunc()\">\n" +\r
12423     "   <div ng-transclude>\n" +\r
12424     "           <i class=\"icon-chevron-down\"></i>\n" +\r
12425     "   </div>\n" +\r
12426     "</div>");\r
12427 }]);\r
12428 \r
12429 angular.module("app/scripts/ng_js_att_tpls/alert/alert.html", []).run(["$templateCache", function($templateCache) {\r
12430   $templateCache.put("app/scripts/ng_js_att_tpls/alert/alert.html",\r
12431     "<div class=\"alert\" ng-class=\"{'alert-success': alertType === 'success', 'alert-warning': alertType === 'warning', 'alert-error': alertType === 'error', 'alert-info': alertType === 'info', 'alert-inplace': showTop !== 'true'}\" ng-show=\"showAlert\" ng-style=\"cssStyle\">\n" +\r
12432     "    <div class=\"container\">\n" +\r
12433     "        <a href=\"javascript:void(0)\" alt=\"close\" class=\"close-role\" ng-click=\"close()\" tabindex=\"0\" att-accessibility-click=\"32,13\">Dismiss <i class=\"icon-circle-action-close\"></i></a>\n" +\r
12434     "        <span ng-transclude> </span>\n" +\r
12435     "    </div>\n" +\r
12436     "</div>");\r
12437 }]);\r
12438 \r
12439 angular.module("app/scripts/ng_js_att_tpls/boardStrip/attAddBoard.html", []).run(["$templateCache", function($templateCache) {\r
12440   $templateCache.put("app/scripts/ng_js_att_tpls/boardStrip/attAddBoard.html",\r
12441     "<div tabindex=\"0\" att-accessibility-click=\"13,32\" ng-click=\"addBoard()\" aria-label=\"Add Board\" class=\"boardstrip-item--add\">\n" +\r
12442     "    <i aria-hidden=\"true\" class=\"icon-add centered\"></i>\n" +\r
12443     "    <br/>\n" +\r
12444     "    <div class=\"centered\">Add board</div>\n" +\r
12445     "</div>");\r
12446 }]);\r
12447 \r
12448 angular.module("app/scripts/ng_js_att_tpls/boardStrip/attBoard.html", []).run(["$templateCache", function($templateCache) {\r
12449   $templateCache.put("app/scripts/ng_js_att_tpls/boardStrip/attBoard.html",\r
12450     "<li att-board-navigation tabindex=\"0\" aria-label=\"{{boardLabel}}\" att-accessibility-click=\"13,32\" ng-click=\"selectBoard(boardIndex)\" class=\"board-item\" ng-class=\"{'selected': getCurrentIndex()===boardIndex}\">\n" +\r
12451     "    <div ng-transclude></div>\n" +\r
12452     "    <div class=\"board-caret\" ng-if=\"getCurrentIndex()===boardIndex\">\n" +\r
12453     "        <div class=\"board-caret-indicator\"></div>\n" +\r
12454     "        <div class=\"board-caret-arrow-up\"></div>\n" +\r
12455     "    </div>\n" +\r
12456     "</li>");\r
12457 }]);\r
12458 \r
12459 angular.module("app/scripts/ng_js_att_tpls/boardStrip/attBoardStrip.html", []).run(["$templateCache", function($templateCache) {\r
12460   $templateCache.put("app/scripts/ng_js_att_tpls/boardStrip/attBoardStrip.html",\r
12461     "<div class=\"att-boardstrip\">\n" +\r
12462     "   <div class=\"boardstrip-reel\">\n" +\r
12463     "           <div class=\"prev-items\" ng-if=\"isPrevBoard()\">\n" +\r
12464     "                   <i tabindex=\"0\" aria-label=\"Scroll Boardstrip Left\" att-accessibility-click=\"13,32\" ng-click=\"prevBoard()\" class=\"arrow icon-arrow-left-circle\"></i>\n" +\r
12465     "           </div>\n" +\r
12466     "           <div att-add-board on-add-board=\"onAddBoard()\"></div>\n" +\r
12467     "           <div class=\"board-viewport\"><ul role=\"presentation\" class=\"boardstrip-container\" ng-transclude></ul></div>\n" +\r
12468     "           <div class=\"next-items\" ng-if=\"isNextBoard()\">\n" +\r
12469     "                   <i tabindex=\"0\" aria-label=\"Scroll Boardstrip Right\" att-accessibility-click=\"13,32\" ng-click=\"nextBoard()\" class=\"arrow icon-arrow-right-circle\"></i>\n" +\r
12470     "           </div>\n" +\r
12471     "   </div>\n" +\r
12472     "</div>");\r
12473 }]);\r
12474 \r
12475 angular.module("app/scripts/ng_js_att_tpls/buttons/buttonDropdown.html", []).run(["$templateCache", function($templateCache) {\r
12476   $templateCache.put("app/scripts/ng_js_att_tpls/buttons/buttonDropdown.html",\r
12477     "<div class=\"att-btn-dropdown\">\n" +\r
12478     "    <div class=\"buttons-dropdown--small btn-group\" ng-class=\"{'open': isOpen}\" att-accessibility-click=\"13,32\" ng-click=\"toggle()\">\n" +\r
12479     "        \n" +\r
12480     "        <button role=\"menu\" class=\"button button--secondary button--small buttons-dropdown__drop dropdown-toggle\" ng-if=\"type==='dots'\" alt=\"Click for Options\" >\n" +\r
12481     "            \n" +\r
12482     "            <div class=\"circle\"></div>\n" +\r
12483     "            <div class=\"circle\"></div>\n" +\r
12484     "            <div class=\"circle\"></div>\n" +\r
12485     "        </button>\n" +\r
12486     "        <button role=\"menu\" class=\"button button--secondary button--small buttons-dropdown__drop dropdown-toggle ng-isolate-scope actions-title\" ng-if=\"type === 'actions'\" alt=\"Actions dropdown Buttons\">Actions</button>\n" +\r
12487     "        \n" +\r
12488     "\n" +\r
12489     "        <ul ng-class=\"{'dropdown-menu dots-dropdwn': type==='dots', 'dropdown-menu actions-dropdwn': type === 'actions'}\" ng-transclude></ul>\n" +\r
12490     "    </div>\n" +\r
12491     "    \n" +\r
12492     "</div>\n" +\r
12493     "");\r
12494 }]);\r
12495 \r
12496 angular.module("app/scripts/ng_js_att_tpls/colorselector/colorselector.html", []).run(["$templateCache", function($templateCache) {\r
12497   $templateCache.put("app/scripts/ng_js_att_tpls/colorselector/colorselector.html",\r
12498     "<div class=\"att-radio att-color-selector__item\"  \n" +\r
12499     "     ng-class=\"{'att-radio--on': (iconColor === selected)}\">\n" +\r
12500     "    <div class=\"att-radio__indicator\" tabindex=\"0\" att-accessibility-click=\"32,13\" ng-click=\"selectedcolor(iconColor)\" \n" +\r
12501     "         ng-style=\"applycolor\" ng-transclude></div>\n" +\r
12502     "</div>");\r
12503 }]);\r
12504 \r
12505 angular.module("app/scripts/ng_js_att_tpls/datepicker/dateFilter.html", []).run(["$templateCache", function($templateCache) {\r
12506   $templateCache.put("app/scripts/ng_js_att_tpls/datepicker/dateFilter.html",\r
12507     "<div class=\"calendar\" ng-class=\"{'monthpicker':mode === 1}\">\n" +\r
12508     "    <div class=\"select2-container\" ng-class=\"{'select2-container-active select2-dropdown-open': showDropdownList}\" style=\"width: 100%; z-index:0\">\n" +\r
12509     "        <a tabindex=\"0\" id=\"select2-choice\" class=\"select2-choice\" href=\"javascript:void(0)\" att-element-focus=\"focusInputButton\" ng-show=\"!showCalendar\" att-accessibility-click=\"13,32\" ng-click=\"showDropdown()\" ng-blur=\"focusInputButton=false\">\n" +\r
12510     "            <span class=\"select2-chosen\" ng-show=\"!showCalendar\">{{selectedOption}}</span>\n" +\r
12511     "            <input type=\"text\" ng-show=\"showCalendar\" ng-blur=\"untrackInputChange($event)\" att-input-deny=\"[^0-9\\/-]\" maxlength=\"{{maxLength}}\" ng-model=\"selectedOption\" aria-labelledby=\"select2-choice\" ng-change=\"getDropdownText()\" />\n" +\r
12512     "            <abbr class=\"select2-search-choice-close\"></abbr>\n" +\r
12513     "            <span ng-class=\"{'select2-arrow': mode !== 1, 'calendar-icon': mode === 1}\"><b></b></span>\n" +\r
12514     "        </a>\n" +\r
12515     "        <a id=\"select2-chosen\" class=\"select2-choice\" href=\"javascript:void(0)\" ng-show=\"showCalendar\">\n" +\r
12516     "            <span class=\"select2-chosen\" ng-show=\"!showCalendar\">{{selectedOption}}</span>\n" +\r
12517     "            <input type=\"text\" ng-show=\"showCalendar\" ng-blur=\"untrackInputChange($event)\" att-input-deny=\"[^0-9\\/-]\" maxlength=\"{{maxLength}}\" ng-model=\"selectedOption\" aria-labelledby=\"select2-chosen\" ng-change=\"getDropdownText()\" />\n" +\r
12518     "            <abbr class=\"select2-search-choice-close\"></abbr>\n" +\r
12519     "            <span tabindex=\"0\" ng-class=\"{'select2-arrow': mode !== 1, 'calendar-icon': mode === 1}\" att-accessibility-click=\"13,32\" ng-click=\"showDropdown()\"><b></b></span>\n" +\r
12520     "        </a>\n" +\r
12521     "    </div>\n" +\r
12522     "    <div class=\"select2-drop select2-drop-active select2-display-none\" ng-style=\"{display: (showDropdownList && 'block') || 'none', 'border-radius': showCalendar && '0 0 0 6px'}\" style=\"width: 100%\">\n" +\r
12523     "        <div  id=\"dateFilterList\" att-scrollbar ><ul class=\"select2-results options\" ng-transclude></ul></div>\n" +\r
12524     "           <ul class=\"select2-results sttings\" style=\"margin-top:0px\">\n" +\r
12525     "                   <li tabindex=\"0\" class=\"select2-result select2-highlighted greyBorder\" ng-class=\"{'select2-result-current': checkCurrentSelection('Custom Single Date')}\" att-accessibility-click=\"13,32\" ng-click=\"selectAdvancedOption('Custom Single Date')\">\n" +\r
12526     "                <div class=\"select2-result-label\" ng-if=\"mode !== 1\">Custom Single Date...</div>\n" +\r
12527     "                           <div class=\"select2-result-label\" ng-if=\"mode === 1\">Custom single month...</div>\n" +\r
12528     "            </li>\n" +\r
12529     "            <li tabindex=\"0\" class=\"select2-result select2-highlighted\" ng-class=\"{'select2-result-current': checkCurrentSelection('Custom Range')}\" att-accessibility-click=\"13,32\" ng-click=\"selectAdvancedOption('Custom Range')\">\n" +\r
12530     "                <div class=\"select2-result-label\" ng-if=\"mode !== 1\">Custom Range...</div>\n" +\r
12531     "                           <div class=\"select2-result-label\" ng-if=\"mode === 1\">Custom month range...</div>\n" +\r
12532     "            </li>\n" +\r
12533     "            <li class=\"select2-result select2-highlighted btnContainer\" ng-style=\"{display: (showCalendar && 'block') || 'none'}\">\n" +\r
12534     "                <button tabindex=\"0\" ng-blur=\"resetFocus($event)\" att-element-focus=\"focusApplyButton\" att-button=\"\" btn-type=\"{{applyButtonType}}\" size=\"small\" att-accessibility-click=\"13,32\" ng-click=\"apply()\">Apply</button>\n" +\r
12535     "                <button tabindex=\"0\" att-button=\"\" btn-type=\"secondary\" size=\"small\" att-accessibility-click=\"13,32\" ng-click=\"cancel()\">Cancel</button>\n" +\r
12536     "                <div>\n" +\r
12537     "                    <a tabindex=\"0\" href=\"javascript:void(0)\" ng-if=\"mode !== 1\" style=\"text-decoration:underline;\" att-accessibility-click=\"13,32\" ng-click=\"clear()\">Clear Dates</a>\n" +\r
12538     "                    <a tabindex=\"0\" href=\"javascript:void(0)\" ng-if=\"mode === 1\" style=\"text-decoration:underline;\" att-accessibility-click=\"13,32\" ng-click=\"clear()\">Clear Months</a>\n" +\r
12539     "                </div>\n" +\r
12540     "            </li>\n" +\r
12541     "           </ul>\n" +\r
12542     "    </div>\n" +\r
12543     "    <div class=\"datepicker-wrapper show-right\" ng-style=\"{display: (showCalendar && 'block') || 'none'}\">\n" +\r
12544     "        <span datepicker ng-blur=\"resetFocus($event)\" att-element-focus=\"focusSingleDateCalendar\" ng-show=\"checkCurrentSelection('Custom Single Date')\"></span>\n" +\r
12545     "        <span datepicker ng-blur=\"resetFocus($event)\" att-element-focus=\"focusRangeCalendar\" ng-show=\"checkCurrentSelection('Custom Range')\"></span>\n" +\r
12546     "    </div>\n" +\r
12547     "</div>\n" +\r
12548     "");\r
12549 }]);\r
12550 \r
12551 angular.module("app/scripts/ng_js_att_tpls/datepicker/dateFilterList.html", []).run(["$templateCache", function($templateCache) {\r
12552   $templateCache.put("app/scripts/ng_js_att_tpls/datepicker/dateFilterList.html",\r
12553     "<li ng-click=\"!disabled && selectOption(fromDate,toDate,caption)\" att-accessibility-click=\"13,32\" ng-class=\"{'select2-result-current': checkCurrentSelection(caption)}\" class=\"select2-result select2-highlighted ng-scope\" tabindex=\"{{!disabled?'0':'-1'}}\">\n" +\r
12554     "                <div class=\"select2-result-label\" ng-class=\"{'disabled':disabled}\" ng-transclude></div>\n" +\r
12555     "</li>");\r
12556 }]);\r
12557 \r
12558 angular.module("app/scripts/ng_js_att_tpls/datepicker/datepicker.html", []).run(["$templateCache", function($templateCache) {\r
12559   $templateCache.put("app/scripts/ng_js_att_tpls/datepicker/datepicker.html",\r
12560     "<div id=\"datepicker\" class=\"datepicker\" ng-class=\"{'monthpicker': mode === 1}\" aria-hidden=\"false\" role=\"dialog\" tabindex=\"-1\" aria-labelledby=\"datepicker\">\n" +\r
12561     "    <div class=\"datepicker-days\" style=\"display: block;\">\n" +\r
12562     "        <table class=\"table-condensed\">\n" +\r
12563     "            <thead>\n" +\r
12564     "                <tr>\n" +\r
12565     "                    <th id=\"month\" tabindex=\"0\" class=\"datepicker-switch\" colspan=\"{{(mode !== 1) && (currentRows[0].length - 2) || (currentRows[0].length)}}\" style=\"text-align:left\">{{currentTitle}}</th>\n" +\r
12566     "                    <th ng-if=\"mode !== 1\" id=\"prev\" aria-hidden=\"{{!disablePrev && 'false'|| 'true'}}\" tabindex=\"{{!disablePrev && '0'|| '-1'}}\" att-accessibility-click=\"13,32\" ng-click=\"!disablePrev && move(-1)\">\n" +\r
12567     "            <div class=\"icons-list\" data-size=\"medium\"><i class=\"icon-arrow-left-circle\" ng-class=\"{'disabled': disablePrev}\" alt=\"Left Arrow\"></i>\n" +\r
12568     "            </div><span class=\"hidden-spoken\">Previous Month</span>\n" +\r
12569     "            </th>\n" +\r
12570     "            <th ng-if=\"mode !== 1\" id=\"next\" aria-hidden=\"{{!disableNext && 'false'|| 'true'}}\" tabindex=\"{{!disableNext && '0'|| '-1'}}\" att-accessibility-click=\"13,32\" ng-click=\"!disableNext && move(1)\">\n" +\r
12571     "            <div class=\"icons-list\" data-size=\"medium\"><i class=\"icon-arrow-right-circle\" ng-class=\"{'disabled': disableNext}\" alt=\"Right Arrow\"></i>\n" +\r
12572     "            </div><span class=\"hidden-spoken\">Next Month</span>\n" +\r
12573     "            </th>\n" +\r
12574     "            </tr>\n" +\r
12575     "            <tr ng-if=\"labels.length > 0\">\n" +\r
12576     "                <th tabindex=\"-1\" class=\"dow weekday\" ng-repeat=\"label in labels\"><span>{{label.pre}}</span></th>\n" +\r
12577     "            </tr>\n" +\r
12578     "            </thead>\n" +\r
12579     "            <tbody>\n" +\r
12580     "                <tr>\n" +\r
12581     "                    <td id=\"datepickerBody\" att-scrollbar colspan=\"{{currentRows[0].length}}\" style=\"padding: 0px;\" headers=\"\">\n" +\r
12582     "                        <table ng-class=\"{'table-condensed': mode === 0, 'monthtable-condensed': mode === 1}\" style=\"padding: 0px;\">\n" +\r
12583     "                            <thead class=\"hidden-spoken\">\n" +\r
12584     "                                <tr ng-show=\"labels.length > 0\">\n" +\r
12585     "                                    <th id=\"{{label.post}}\" tabindex=\"-1\" class=\"dow weekday\" ng-repeat=\"label in labels\"></th>\n" +\r
12586     "                                </tr>\n" +\r
12587     "                            </thead>\n" +\r
12588     "                            <tbody>\n" +\r
12589     "                                <tr ng-repeat=\"row in currentRows\">\n" +\r
12590     "                                    <td headers=\"{{(mode === 0) && dt.header || 'month'}}\" att-element-focus=\"dt.focused\" aria-hidden=\"{{(!dt.oldMonth && !dt.nextMonth && !dt.disabled && 'false') || 'true'}}\" tabindex=\"{{(!dt.oldMonth && !dt.nextMonth && !dt.disabled && '0') || '-1'}}\" ng-repeat=\"dt in row\" class=\"days\" ng-class=\"{'active': dt.selected || dt.from || dt.to, 'from': dt.from, 'to': dt.to, 'range': dt.dateRange, 'prev-month ': dt.oldMonth, 'next-month': dt.nextMonth, 'disabled': dt.disabled, 'today': dt.today, 'weekend': dt.weekend}\" ng-click=\"!dt.selected && !dt.from && !dt.to && !dt.disabled && !dt.oldMonth && !dt.nextMonth && select(dt.date)\" att-accessibility-click=\"13,32\" aria-label=\"{{dt.date | date : 'EEEE, MMMM d'}}\"><span class=\"day\">{{dt.label}}</span></td>\n" +\r
12591     "                                </tr>\n" +\r
12592     "                                <tr ng-if=\"mode === 1\" class=\"divider\"><td colspan=\"{{nextRows[0].length}}\"><hr></td></tr>\n" +\r
12593     "                                <tr>\n" +\r
12594     "                                    <th id=\"month\" tabindex=\"0\" class=\"datepicker-switch internal\" colspan=\"{{nextRows[0].length}}\" style=\"text-align:left\">{{nextTitle}}</th>\n" +\r
12595     "                                </tr>\n" +\r
12596     "                                <tr ng-repeat=\"row in nextRows\">\n" +\r
12597     "                                    <td headers=\"{{(mode === 0) && dt.header || 'month'}}\" att-element-focus=\"dt.focused\" aria-hidden=\"{{(!dt.oldMonth && !dt.nextMonth && !dt.disabled && 'false') || 'true'}}\" tabindex=\"{{(!dt.oldMonth && !dt.nextMonth && !dt.disabled && '0') || '-1'}}\" ng-repeat=\"dt in row\" class=\"days\" ng-class=\"{'active': dt.selected || dt.from || dt.to, 'from': dt.from, 'to': dt.to, 'range': dt.dateRange, 'prev-month ': dt.oldMonth, 'next-month': dt.nextMonth, 'disabled': dt.disabled, 'today': dt.today, 'weekend': dt.weekend}\" ng-click=\"!dt.selected && !dt.from && !dt.to && !dt.disabled && !dt.oldMonth && !dt.nextMonth && select(dt.date)\" att-accessibility-click=\"13,32\" aria-label=\"{{dt.date | date : 'EEEE, MMMM d'}}\"><span class=\"day\">{{dt.label}}</span></td>\n" +\r
12598     "                                </tr>\n" +\r
12599     "                            </tbody>\n" +\r
12600     "                        </table>\n" +\r
12601     "                    </td>\n" +\r
12602     "                </tr>\n" +\r
12603     "            </tbody>\n" +\r
12604     "        </table>\n" +\r
12605     "    </div>\n" +\r
12606     "</div>\n" +\r
12607     "");\r
12608 }]);\r
12609 \r
12610 angular.module("app/scripts/ng_js_att_tpls/datepicker/datepickerPopup.html", []).run(["$templateCache", function($templateCache) {\r
12611   $templateCache.put("app/scripts/ng_js_att_tpls/datepicker/datepickerPopup.html",\r
12612     "<div class=\"calendar\">\n" +\r
12613     "    <div class=\"box\" ng-class=\"{'active': isOpen}\">\n" +\r
12614     "        <span ng-transclude></span>\n" +\r
12615     "        <i class=\"calendar-icon\" tabindex=\"0\" att-accessibility-click=\"13,32\" ng-click=\"toggle()\" alt=\"Calendar Icon\"></i>\n" +\r
12616     "    </div>\n" +\r
12617     "    <div class=\"datepicker-wrapper datepicker-wrapper-display-none\" ng-style=\"{display: (isOpen && 'block') || 'none'}\" aria-hidden=\"false\" role=\"dialog\" tabindex=\"-1\">\n" +\r
12618     "        <span datepicker></span>\n" +\r
12619     "    </div>\n" +\r
12620     "</div>\n" +\r
12621     "");\r
12622 }]);\r
12623 \r
12624 angular.module("app/scripts/ng_js_att_tpls/dividerLines/dividerLines.html", []).run(["$templateCache", function($templateCache) {\r
12625   $templateCache.put("app/scripts/ng_js_att_tpls/dividerLines/dividerLines.html",\r
12626     "<div class=\"divider-container\" ng-class=\"{'divider-container-light': lightContainer}\">\n" +\r
12627     "    <hr ng-class=\"{'divider-light': lightContainer}\">\n" +\r
12628     "</div>\n" +\r
12629     "\n" +\r
12630     "");\r
12631 }]);\r
12632 \r
12633 angular.module("app/scripts/ng_js_att_tpls/dragdrop/fileUpload.html", []).run(["$templateCache", function($templateCache) {\r
12634   $templateCache.put("app/scripts/ng_js_att_tpls/dragdrop/fileUpload.html",\r
12635     "<label class=\"fileContainer\"><span ng-transclude></span><input type=\"file\" att-file-change></label>");\r
12636 }]);\r
12637 \r
12638 angular.module("app/scripts/ng_js_att_tpls/formField/attFormFieldValidationAlert.html", []).run(["$templateCache", function($templateCache) {\r
12639   $templateCache.put("app/scripts/ng_js_att_tpls/formField/attFormFieldValidationAlert.html",\r
12640     "<div class=\"form-field\" ng-class=\"{'error': errorMessage, 'warning': warningMessage}\">\n" +\r
12641     "    <label class=\"form-field__label\" ng-class=\"{'form-field__label--show': showLabel, 'form-field__label--hide': hideLabel}\"></label>\n" +\r
12642     "    <div class=\"form-field-input-container\" ng-transclude></div>\n" +\r
12643     "</div>");\r
12644 }]);\r
12645 \r
12646 angular.module("app/scripts/ng_js_att_tpls/formField/attFormFieldValidationAlertPrv.html", []).run(["$templateCache", function($templateCache) {\r
12647   $templateCache.put("app/scripts/ng_js_att_tpls/formField/attFormFieldValidationAlertPrv.html",\r
12648     "<div class=\"form-field\" ng-class=\"{'error':hideErrorMsg}\">\n" +\r
12649     "    <div class=\"form-field-input-container\" ng-transclude></div>\n" +\r
12650     "   <div class=\"form-field__message error\" type=\"error\" ng-show=\"hideErrorMsg\" >\n" +\r
12651     "           <i class=\"icon-info-alert\"></i>{{errorMessage}}\n" +\r
12652     "   </div>\n" +\r
12653     "</div>\n" +\r
12654     "");\r
12655 }]);\r
12656 \r
12657 angular.module("app/scripts/ng_js_att_tpls/formField/creditCardImage.html", []).run(["$templateCache", function($templateCache) {\r
12658   $templateCache.put("app/scripts/ng_js_att_tpls/formField/creditCardImage.html",\r
12659     "<span class=\"css-sprite pull-right\">\n" +\r
12660     "<span class=\"hidden-spoken\">We accept</span>\n" +\r
12661     "<ul class=\"{{newValCCI}}\">\n" +\r
12662     "        <li class=\"css-sprite-mc\"><span class=\"hidden-spoken\">MasterCard</span></li>\n" +\r
12663     "        <li class=\"css-sprite-visa\"><span class=\"hidden-spoken\">Visa</span></li>\n" +\r
12664     "        <li class=\"css-sprite-amex\"><span class=\"hidden-spoken\">American Express</span></li>\n" +\r
12665     "        <li class=\"css-sprite-discover\"><span class=\"hidden-spoken\">Discover</span></li>                                                                                                               \n" +\r
12666     "</ul>\n" +\r
12667     "</span>\n" +\r
12668     "<label for=\"ccForm.card\" class=\"pull-left\">Card number</label>");\r
12669 }]);\r
12670 \r
12671 angular.module("app/scripts/ng_js_att_tpls/formField/cvcSecurityImg.html", []).run(["$templateCache", function($templateCache) {\r
12672   $templateCache.put("app/scripts/ng_js_att_tpls/formField/cvcSecurityImg.html",\r
12673     "<div>\n" +\r
12674     "<button type=\"button\" class=\"btn btn-alt btn-tooltip\" style=\"padding-top:16px\" title=\"Help\"><i class=\"hidden-spoken\">Help</i></button>\n" +\r
12675     "<div class=\"helpertext\" role=\"tooltip\">\n" +\r
12676     "<div class=\"popover-title\"></div>\n" +\r
12677     "<div class=\"popover-content\">\n" +\r
12678     "    <p class=\"text-legal cvc-cc\">\n" +\r
12679     "        <img ng-src=\"images/{{newValI}}.png\" alt=\"{{newValIAlt}}\">\n" +\r
12680     "    </p>\n" +\r
12681     "</div>\n" +\r
12682     "</div>\n" +\r
12683     "</div>\n" +\r
12684     "");\r
12685 }]);\r
12686 \r
12687 angular.module("app/scripts/ng_js_att_tpls/hourpicker/hourpicker.html", []).run(["$templateCache", function($templateCache) {\r
12688   $templateCache.put("app/scripts/ng_js_att_tpls/hourpicker/hourpicker.html",\r
12689     "<div class=\"hourpicker\">\n" +\r
12690     "    <div class=\"dropdown-width\">\n" +\r
12691     "        <div ng-model=\"showlist\" class=\"select2-container topDropDownWidth\" ng-class=\"{'select2-dropdown-open select2-container-active': showlist}\" >\n" +\r
12692     "            <a class=\"select2-choice\" href=\"javascript:void(0)\" id=\"customSelect\" ng-keydown=\"selectOption(selectPrevNextValue($event,options,selectedOption))\" att-accessibility-click=\"13\" ng-click=\"showDropdown()\">\n" +\r
12693     "                <span class=\"select2-chosen\">{{selectedOption}}</span>\n" +\r
12694     "                <span class=\"select2-arrow\"><b></b></span>\n" +\r
12695     "            </a>\n" +\r
12696     "        </div>             \n" +\r
12697     "        <div class=\"select2-display-none select2-with-searchbox select2-drop-active show-search resultTopWidth\" ng-show=\"showlist\">       \n" +\r
12698     "        <ul class=\"select2-results resultTopMargin\" >                       \n" +\r
12699     "            <li  ng-model=\"ListType\" ng-repeat=\"option in options\" att-accessibility-click=\"13\" ng-click=\"selectOption(option,$index)\" class=\"select2-results-dept-0 select2-result select2-result-selectable\"><div class=\"select2-result-label\"><span >{{option}}</span></div></li>                        \n" +\r
12700     "        </ul>\n" +\r
12701     "        </div>\n" +\r
12702     "    </div>\n" +\r
12703     "    <div ng-show=\"showDaysSelector\" class=\"customdays-width\">\n" +\r
12704     "        <div att-divider-lines class=\"divider-margin-f\"></div>  \n" +\r
12705     "        <div class=\"col-md-3 fromto-margin\">\n" +\r
12706     "            <div>From</div> <br>\n" +\r
12707     "            <div>To</div>\n" +\r
12708     "        </div>\n" +\r
12709     "        <div ng-repeat=\"day in days\">\n" +\r
12710     "            <div class=\"col-md-3 col-md-days\">\n" +\r
12711     "                <div  class=\"col-md-1 daysselect-margin\">\n" +\r
12712     "                    <input type=\"checkbox\" ng-model=\"daysList[day]\" title=\"Day selection {{$index}}\" att-checkbox ng-change=\"addSelectedValue(day)\">    \n" +\r
12713     "                </div>\n" +\r
12714     "                <span>{{day}}</span><br>\n" +\r
12715     "                \n" +\r
12716     "                <div class=\"dropDownMarginBottom\">\n" +\r
12717     "                    <div class=\"select2-container topDropDownWidth\" ng-class=\"{'select2-dropdown-open select2-container-active': FrtimeListDay[day]}\" >\n" +\r
12718     "                        <a class=\"select2-choice selectDropDown\" href=\"javascript:void(0)\" tabindex=\"{{daysList[day] ? '0' : '-1'}}\" att-accessibility-click=\"13\" ng-click=\"daysList[day] && showfromDayDropdown(day)\" ng-class=\"{'select2-chosen-disabled':!daysList[day]}\"  ng-keydown=\"daysList[day] && selectFromDayOption(day , selectPrevNextValue($event,fromtime,selectedFromOption[day]));daysList[day] && addSelectedValue(day);\">\n" +\r
12719     "                            <span class=\"select2-chosen dropDownMarginRight\" >{{selectedFromOption[day]}} <i ng-if=\"daysList[day]\" ng-class=\"FrtimeListDay[day] ? 'icon-dropdown-up' : 'icon-dropdown-down'\"></i></span>\n" +\r
12720     "                        </a>\n" +\r
12721     "                    </div>             \n" +\r
12722     "                    \n" +\r
12723     "                    <div class=\"select2-display-none select2-with-searchbox select2-drop-active show-search resultFromDropDown\"  ng-show=\"FrtimeListDay[day]\">       \n" +\r
12724     "                    <ul class=\"select2-results resultTopMargin\" >                       \n" +\r
12725     "                        <li ng-click=\"selectFromDayOption(day,time.value);addSelectedValue(day);\" ng-repeat=\"time in fromtime\"  class=\"select2-results-dept-0 select2-result select2-result-selectable\"><div class=\"select2-result-label\" ng-class=\"{'selectedItemInDropDown': (time.value==selectedFromOption[day])}\"><span >{{time.value}}</span></div></li>                        \n" +\r
12726     "                    </ul>\n" +\r
12727     "                    </div>\n" +\r
12728     "                </div>\n" +\r
12729     "                \n" +\r
12730     "                <div class=\"dropDownMarginBottom\">\n" +\r
12731     "                    <div class=\"select2-container topDropDownWidth\" ng-class=\"{'select2-dropdown-open select2-container-active': TotimeListDay[day]}\" >\n" +\r
12732     "                        <a class=\"select2-choice selectDropDown\" href=\"javascript:void(0)\" tabindex=\"{{daysList[day] ? '0' : '-1'}}\" att-accessibility-click=\"13\" ng-click=\"daysList[day] && showtoDayDropdown(day)\" ng-class=\"{'select2-chosen-disabled':!daysList[day], 'selectDropDown-error':daysList[day] && showToTimeErrorDay[day]}\"  ng-keydown=\"daysList[day] && selectToDayOption(day , selectPrevNextValue($event,totime,selectedToOption[day]));daysList[day] && addSelectedValue(day);\">\n" +\r
12733     "                            <span class=\"select2-chosen dropDownMarginRight\">{{selectedToOption[day]}} <i ng-if=\"daysList[day]\" ng-class=\"TotimeListDay[day] ? 'icon-dropdown-up' : 'icon-dropdown-down'\" ></i></span>\n" +\r
12734     "                        </a>\n" +\r
12735     "                    </div>\n" +\r
12736     "                    \n" +\r
12737     "                    <div class=\"select2-display-none select2-with-searchbox select2-drop-active show-search resultToDropDown\" ng-show=\"TotimeListDay[day]\">       \n" +\r
12738     "                    <ul class=\"select2-results resultTopMargin\" >                       \n" +\r
12739     "                        <li ng-click=\"selectToDayOption(day,time.value);addSelectedValue(day);\" ng-repeat=\"time in totime\"  class=\"select2-results-dept-0 select2-result select2-result-selectable\"><div class=\"select2-result-label\" ng-class=\"{'selectedItemInDropDown': (time.value==selectedToOption[day])}\"><span >{{time.value}}</span></div></li>                        \n" +\r
12740     "                    </ul>\n" +\r
12741     "                    </div>\n" +\r
12742     "                </div>\n" +\r
12743     "            </div>  \n" +\r
12744     "        </div>    \n" +\r
12745     "        <div att-divider-lines class=\"divider-margin-s\"></div>\n" +\r
12746     "    </div>\n" +\r
12747     "    <div ng-transclude></div>\n" +\r
12748     "</div>");\r
12749 }]);\r
12750 \r
12751 angular.module("app/scripts/ng_js_att_tpls/links/readMore.html", []).run(["$templateCache", function($templateCache) {\r
12752   $templateCache.put("app/scripts/ng_js_att_tpls/links/readMore.html",\r
12753     "<div>\n" +\r
12754     "    <div ng-bind-html=\"textToDisplay\" ng-class=\"{'att--readMore': readFlag, 'att--readLess': !readFlag}\" ng-style=\"readLinkStyle\"></div>\n" +\r
12755     "    <span class=\"att--readmore__link\" ng-show=\"readMoreLink\">… <a href=\"javascript:void(0);\" ng-click=\"readMore()\" att-accessbility-click=\"32,13\">Read More</a>\n" +\r
12756     "    </span>\n" +\r
12757     "</div>\n" +\r
12758     "<span class=\"att--readless__link\" ng-show=\"readLessLink\">\n" +\r
12759     "    <a href=\"javascript:void(0);\" ng-click=\"readLess()\" att-accessbility-click=\"32,13\">Read Less</a>\n" +\r
12760     "</span>");\r
12761 }]);\r
12762 \r
12763 angular.module("app/scripts/ng_js_att_tpls/loading/loading.html", []).run(["$templateCache", function($templateCache) {\r
12764   $templateCache.put("app/scripts/ng_js_att_tpls/loading/loading.html",\r
12765     "<div data-progress=\"{{progressStatus}}\" class=\"{{colorClass}}\" ng-class=\"{'att-loading-count':icon == 'count','loading--small':icon == 'small','loading': icon != 'count'}\" alt=\"Loading\">\n" +\r
12766     "   <div class=\"att-loading-circle\" ng-if=\"icon == 'count'\">\n" +\r
12767     "           <div class=\"att-loading-circle__mask att-loading-circle__full\">\n" +\r
12768     "                   <div class=\"att-loading-circle__fill\"></div>\n" +\r
12769     "           </div>\n" +\r
12770     "           <div class=\"att-loading-circle__mask att-loading-circle__half\">\n" +\r
12771     "                   <div class=\"att-loading-circle__fill\"></div>\n" +\r
12772     "                   <div class=\"att-loading-circle__fill att-loading-circle__fix\"></div>\n" +\r
12773     "           </div>\n" +\r
12774     "   </div>\n" +\r
12775     "   <div ng-class=\"{'att-loading-inset':icon == 'count','loading__inside':icon != 'count'}\"><div class=\"att-loading-inset__percentage\" ng-if=\"icon == 'count'\" alt=\"Loading with Count\"></div></div>\n" +\r
12776     "</div>\n" +\r
12777     "\n" +\r
12778     "");\r
12779 }]);\r
12780 \r
12781 angular.module("app/scripts/ng_js_att_tpls/modal/backdrop.html", []).run(["$templateCache", function($templateCache) {\r
12782   $templateCache.put("app/scripts/ng_js_att_tpls/modal/backdrop.html",\r
12783     "<div class=\"overlayed\" ng-class=\"{show: animate}\" \n" +\r
12784     "     ng-style=\"{'z-index': 2000 + index*10,'overflow':'scroll'}\">         \n" +\r
12785     "</div>");\r
12786 }]);\r
12787 \r
12788 angular.module("app/scripts/ng_js_att_tpls/modal/tabbedItem.html", []).run(["$templateCache", function($templateCache) {\r
12789   $templateCache.put("app/scripts/ng_js_att_tpls/modal/tabbedItem.html",\r
12790     "<div>\n" +\r
12791     "    <ul class=\"tabs_overlay\">\n" +\r
12792     "        <li ng-repeat=\"item in items\" class=\"tabs_overlay__item two__item\" ng-class=\"{'active':isActiveTab($index)}\" ng-click=\"clickTab($index)\">\n" +\r
12793     "            <i class=\"{{item.iconClass}}\"></i>\n" +\r
12794     "            {{item.title}} ({{item.number}})\n" +\r
12795     "            <a class=\"viewLink\" att-link>Show</a>\n" +\r
12796     "        </li>\n" +\r
12797     "    </ul>\n" +\r
12798     "</div>");\r
12799 }]);\r
12800 \r
12801 angular.module("app/scripts/ng_js_att_tpls/modal/tabbedOverlayItem.html", []).run(["$templateCache", function($templateCache) {\r
12802   $templateCache.put("app/scripts/ng_js_att_tpls/modal/tabbedOverlayItem.html",\r
12803     "<div>\n" +\r
12804     "    <ul class=\"tabs_overlay\">\n" +\r
12805     "        <li ng-repeat=\"item in items\" class=\"tabs_overlay__item two__item\" ng-class=\"{'active':isActiveTab($index)}\" ng-click=\"clickTab($index)\">\n" +\r
12806     "            <i class=\"{{item.iconClass}}\"></i>\n" +\r
12807     "            {{item.title}} ({{item.number}})\n" +\r
12808     "            <a class=\"viewLink\" att-link>Show</a>\n" +\r
12809     "        </li>\n" +\r
12810     "    </ul>\n" +\r
12811     "</div>");\r
12812 }]);\r
12813 \r
12814 angular.module("app/scripts/ng_js_att_tpls/modal/window.html", []).run(["$templateCache", function($templateCache) {\r
12815   $templateCache.put("app/scripts/ng_js_att_tpls/modal/window.html",\r
12816     "<div tabindex=\"-1\" role=\"dialog\" att-element-focus=\"focusModalFlag\" class=\"modals {{ windowClass }}\" ng-class=\"{show: animate}\" \n" +\r
12817     "     ng-style=\"{'z-index': 2010 + index*10}\"  ng-click=\"close($event)\" ng-transclude>         \n" +\r
12818     "</div>\n" +\r
12819     "");\r
12820 }]);\r
12821 \r
12822 angular.module("app/scripts/ng_js_att_tpls/pagination/pagination.html", []).run(["$templateCache", function($templateCache) {\r
12823   $templateCache.put("app/scripts/ng_js_att_tpls/pagination/pagination.html",\r
12824     "<div class=\"pager\">\n" +\r
12825     "    <a tabindex=\"0\" href=\"javascript:void(0)\" class=\"pager__item--prev\" att-accessibility-click=\"13,32\" ng-click=\"prev($event)\" ng-if=\"currentPage > 1\"><i class=\"icon-arrow-left\"></i> Previous</a>\n" +\r
12826     "    <a tabindex=\"0\" href=\"javascript:void(0)\" class=\"pager__item pager__item--link\" ng-if=\"totalPages > 7 && currentPage > 3\" att-accessibility-click=\"13,32\" ng-click=\"selectPage(1, $event)\">1</a>\n" +\r
12827     "    <span class=\"pager__item\" ng-if=\"totalPages > 7 && currentPage > 3\">...</span>\n" +\r
12828     "    <a tabindex=\"0\" href=\"javascript:void(0)\" class=\"pager__item pager__item--link\" att-element-focus=\"isFocused(page)\" ng-repeat=\"page in pages\" ng-class=\"{'pager__item--active': checkSelectedPage(page)}\" att-accessibility-click=\"13,32\" ng-click=\"selectPage(page, $event)\">{{page}}</a>\n" +\r
12829     "    <span class=\"pager__item\" ng-if=\"totalPages > 7 && currentPage < totalPages - 2 && showInput !== true\">...</span>\n" +\r
12830     "    <span ng-show=\"totalPages > 7 && showInput === true\"><input class=\"pager__item--input\" type=\"text\" placeholder=\"...\" maxlength=\"2\" ng-model=\"currentPage\" aria-label=\"Current page count\"/></span>\n" +\r
12831     "    <a tabindex=\"0\" href=\"javascript:void(0)\" class=\"pager__item pager__item--link\" ng-if=\"totalPages > 7 && currentPage < totalPages - 2\" att-accessibility-click=\"13,32\" ng-click=\"selectPage(totalPages, $event)\">{{totalPages}}</a>\n" +\r
12832     "    <a tabindex=\"0\" href=\"javascript:void(0)\" class=\"pager__item--next\" att-accessibility-click=\"13,32\" ng-click=\"next($event)\" ng-if=\"currentPage < totalPages\">Next <i class=\"icon-arrow-right\"></i></a>\n" +\r
12833     "</div>");\r
12834 }]);\r
12835 \r
12836 angular.module("app/scripts/ng_js_att_tpls/paneSelector/innerPane.html", []).run(["$templateCache", function($templateCache) {\r
12837   $templateCache.put("app/scripts/ng_js_att_tpls/paneSelector/innerPane.html",\r
12838     "<div class='inner-pane' ng-transclude></div>");\r
12839 }]);\r
12840 \r
12841 angular.module("app/scripts/ng_js_att_tpls/paneSelector/paneGroup.html", []).run(["$templateCache", function($templateCache) {\r
12842   $templateCache.put("app/scripts/ng_js_att_tpls/paneSelector/paneGroup.html",\r
12843     "<div class='pane-group' ng-transclude></div>");\r
12844 }]);\r
12845 \r
12846 angular.module("app/scripts/ng_js_att_tpls/paneSelector/sidePane.html", []).run(["$templateCache", function($templateCache) {\r
12847   $templateCache.put("app/scripts/ng_js_att_tpls/paneSelector/sidePane.html",\r
12848     "<div class='side-pane' ng-transclude></div>");\r
12849 }]);\r
12850 \r
12851 angular.module("app/scripts/ng_js_att_tpls/tooltip/tooltip-popup.html", []).run(["$templateCache", function($templateCache) {\r
12852   $templateCache.put("app/scripts/ng_js_att_tpls/tooltip/tooltip-popup.html",\r
12853     "<div class=\"att-tooltip \" \n" +\r
12854     "     ng-class=\"{ 'att-tooltip--on': isOpen, \n" +\r
12855     "                'att-tooltip--dark att-tooltip--dark--hover':stylett=='dark', \n" +\r
12856     "                'att-tooltip--light att-tooltip--light--hover':stylett=='light',\n" +\r
12857     "                'att-tooltip--left':placement=='left', \n" +\r
12858     "                'att-tooltip--above':placement=='above', \n" +\r
12859     "                'att-tooltip--right':placement=='right', \n" +\r
12860     "                'att-tooltip--below':placement=='below'}\" \n" +\r
12861     "    ng-bind-html=\"content | unsafe\" ></div>");\r
12862 }]);\r
12863 \r
12864 angular.module("app/scripts/ng_js_att_tpls/popOvers/popOvers.html", []).run(["$templateCache", function($templateCache) {\r
12865   $templateCache.put("app/scripts/ng_js_att_tpls/popOvers/popOvers.html",\r
12866     "<div class=\"att-popover popover-demo\" ng-style=\"{backgroundColor:popOverStyle}\"\n" +\r
12867     "     ng-class=\"{'att-tooltip--dark':popOverStyle==='grey',\n" +\r
12868     "                'att-pop-over--left':popOverPlacement==='left', \n" +\r
12869     "                'att-pop-over--above':popOverPlacement==='above', \n" +\r
12870     "                'att-pop-over--right':popOverPlacement==='right'}\" \n" +\r
12871     "    style='position: absolute; max-width: 490px;'>\n" +\r
12872     "    <div class=\"pop-over-caret\"\n" +\r
12873     "         ng-class=\"{'pop-over-caret-border--left':popOverPlacement==='left', \n" +\r
12874     "                'pop-over-caret-border--above':popOverPlacement==='above', \n" +\r
12875     "                'pop-over-caret-border--right':popOverPlacement==='right', \n" +\r
12876     "                'pop-over-caret-border--below':popOverPlacement==='below'}\">\n" +\r
12877     "    </div>\n" +\r
12878     "    <div class=\"pop-over-caret\" ng-style=\"popOverPlacement=='below' && {borderBottom:'6px solid ' +popOverStyle}||popOverPlacement=='left' && {borderLeft:'6px solid ' +popOverStyle}||popOverPlacement=='right' && {borderRight:'6px solid ' +popOverStyle}||popOverPlacement=='above' && {borderTop:'6px solid ' +popOverStyle}\"\n" +\r
12879     "         ng-class=\"{'pop-over-caret--left':popOverPlacement==='left', \n" +\r
12880     "                'pop-over-caret--above':popOverPlacement==='above', \n" +\r
12881     "                'pop-over-caret--right':popOverPlacement==='right', \n" +\r
12882     "                'pop-over-caret--below':popOverPlacement==='below'}\"></div>\n" +\r
12883     "    \n" +\r
12884     "    <div class=\"att-popover-content\">\n" +\r
12885     "   <a ng-if=\"closeable\" href=\"javascript:void(0)\" class=\"icon-close att-popover__close\" ng-click=\"closeMe();$event.preventDefault()\"></a>\n" +\r
12886     "        <div class=\"popover-packages__container\" ng-include=\"content\"></div>\n" +\r
12887     "    </div>\n" +\r
12888     "</div>");\r
12889 }]);\r
12890 \r
12891 angular.module("app/scripts/ng_js_att_tpls/profileCard/addUser.html", []).run(["$templateCache", function($templateCache) {\r
12892   $templateCache.put("app/scripts/ng_js_att_tpls/profileCard/addUser.html",\r
12893     "<div  class=\"col-md-9 profile-card add-user\">\n" +\r
12894     "    <div class=\"atcenter\">\n" +\r
12895     "        <div><i class=\"icon-add\"></i></div>\n" +\r
12896     "        <span>add User</span>\n" +\r
12897     "    </div>\n" +\r
12898     "</div>");\r
12899 }]);\r
12900 \r
12901 angular.module("app/scripts/ng_js_att_tpls/profileCard/profileCard.html", []).run(["$templateCache", function($templateCache) {\r
12902   $templateCache.put("app/scripts/ng_js_att_tpls/profileCard/profileCard.html",\r
12903     "<div class=\"col-md-9 profile-card\">\n" +\r
12904     "    <div class=\"top-block\">\n" +\r
12905     "       <div class=\"profile-image\">\n" +\r
12906     "            <img ng-if=\"image\" profile-name=\"{{profile.name}}\" ng-src=\"{{profile.img}}\" alt=\"{{profile.name}}\">\n" +\r
12907     "            <span ng-hide=\"image\" class=\"default-img\">{{initials}}</span>\n" +\r
12908     "            <p class=\"name\" tooltip-condition=\"{{profile.name}}\" height=\"true\"></p>\n" +\r
12909     "            <p class=\"status\">\n" +\r
12910     "                <span class=\"status-icon\" ng-class=\"{'icon-green':colorIcon==='green','icon-red':colorIcon==='red','icon-blue':colorIcon==='blue','icon-yellow':colorIcon==='yellow'}\">   \n" +\r
12911     "                </span>\n" +\r
12912     "                <span>{{profile.state}}<span ng-if=\"badge\" class=\"status-badge\">Admin</span></span>\n" +\r
12913     "            </p>\n" +\r
12914     "        </div>\n" +\r
12915     "    </div>\n" +\r
12916     "    <div class=\"bottom-block\">\n" +\r
12917     "         <div class=\"profile-details\">\n" +\r
12918     "            <label>Username</label>\n" +\r
12919     "            <p att-text-overflow=\"92%\" tooltip-condition=\"{{profile.userName}}\">{{profile.userName}}</p>\n" +\r
12920     "            <label>Email</label>\n" +\r
12921     "            <p att-text-overflow=\"92%\" tooltip-condition=\"{{profile.email}}\">{{profile.email}}</p>\n" +\r
12922     "            <label>Role</label>\n" +\r
12923     "            <p att-text-overflow=\"92%\" tooltip-condition=\"{{profile.role}}\">{{profile.role}}</p>\n" +\r
12924     "            <label>Last Login</label>\n" +\r
12925     "            <p att-text-overflow=\"92%\" tooltip-condition=\"{{profile.lastLogin}}\">{{profile.lastLogin}}</p>\n" +\r
12926     "         </div>\n" +\r
12927     "    </div>\n" +\r
12928     "</div>");\r
12929 }]);\r
12930 \r
12931 angular.module("app/scripts/ng_js_att_tpls/progressBars/progressBars.html", []).run(["$templateCache", function($templateCache) {\r
12932   $templateCache.put("app/scripts/ng_js_att_tpls/progressBars/progressBars.html",\r
12933     "<div class=\"att-progress\">\n" +\r
12934     "    <div class=\"att-progress-value\">&nbsp;</div>\n" +\r
12935     "</div>");\r
12936 }]);\r
12937 \r
12938 angular.module("app/scripts/ng_js_att_tpls/scrollbar/scrollbar.html", []).run(["$templateCache", function($templateCache) {\r
12939   $templateCache.put("app/scripts/ng_js_att_tpls/scrollbar/scrollbar.html",\r
12940     "<div class=\"scroll-bar\" style=\"position: absolute\">\n" +\r
12941     "    <div class=\"scroll-thumb\" style=\"position: absolute; overflow: hidden\"></div>\n" +\r
12942     "</div>\n" +\r
12943     "<div class=\"prev icons-list\" data-size=\"medium\" ng-show=\"navigation && prevAvailable\" ng-style=\"{height: scrollbarAxis === 'x' && position.height + 'px'}\">\n" +\r
12944     "    <a href=\"javascript:void(0);\" ng-click=\"customScroll(false)\" aria-label=\"Scroll\" aria-hidden=\"true\">\n" +\r
12945     "        <i ng-class=\"{'icon-chevron-up': (scrollbarAxis === 'y'), 'icon-chevron-left': (scrollbarAxis === 'x')}\"></i>\n" +\r
12946     "    </a>\n" +\r
12947     "</div>\n" +\r
12948     "<div class=\"scroll-viewport\" ng-style=\"{height: (scrollbarAxis === 'x' && position.height + 'px') || viewportHeight, width: viewportWidth}\" style=\"position: relative; overflow: hidden\">\n" +\r
12949     "    <div class=\"scroll-overview\" style=\"position: absolute; display: table; width: 100%\" att-position=\"position\" ng-transclude></div>\n" +\r
12950     "</div>\n" +\r
12951     "<div class='next icons-list' data-size=\"medium\" ng-show=\"navigation && nextAvailable\" ng-style=\"{height: scrollbarAxis === 'x' && position.height + 'px'}\">\n" +\r
12952     "    <a href=\"javascript:void(0);\" ng-click=\"customScroll(true)\" aria-label=\"Scroll\" aria-hidden=\"true\">\n" +\r
12953     "        <i ng-class=\"{'icon-chevron-down': (scrollbarAxis === 'y'), 'icon-chevron-right': (scrollbarAxis === 'x')}\"></i>\n" +\r
12954     "    </a>\n" +\r
12955     "</div>\n" +\r
12956     "");\r
12957 }]);\r
12958 \r
12959 angular.module("app/scripts/ng_js_att_tpls/search/search.html", []).run(["$templateCache", function($templateCache) {\r
12960   $templateCache.put("app/scripts/ng_js_att_tpls/search/search.html",\r
12961     "<div class=\"select2-container show-search\" ng-class=\"{'select2-dropdown-open': (showlist && !isDisabled),'select2-container-disabled':isDisabled, 'select2-container-active': isact}\" ng-init=\"isact=false;\" style=\"width: 100%;\">\n" +\r
12962     "    <a href=\"javascript:void(0)\" class=\"select2-choice needsclick\" tabindex=\"0\" ng-click=\"showDropdown()\" ng-class=\"{'select2-chosen-disabled':isDisabled}\" role=\"combobox\" aria-expanded=\"{{showlist}}\" aria-owns=\"inList\" aria-label=\"{{selectedOption}} selected\" ng-focus=\"isact=true;\" ng-blur=\"isact=false;\">\n" +\r
12963     "        <span class=\"select2-chosen needsclick\" aria-hidden = \"true\">{{selectedOption}}</span>\n" +\r
12964     "        <abbr class=\"select2-search-choice-close needsclick\"></abbr>\n" +\r
12965     "        <span class=\"select2-arrow needsclick\" role=\"presentation\">\n" +\r
12966     "            <b role=\"presentation\" class=\"needsclick\"></b>\n" +\r
12967     "        </span>\n" +\r
12968     "    </a>    \n" +\r
12969     "    <input class=\"select2-focusser select2-offscreen\"            \n" +\r
12970     "           tabindex=\"-1\" \n" +\r
12971     "           type=\"text\" \n" +\r
12972     "           aria-hidden=\"true\" \n" +\r
12973     "           title=\"hidden\"           \n" +\r
12974     "           aria-haspopup=\"true\"           \n" +\r
12975     "           role=\"button\">    \n" +\r
12976     "</div>\n" +\r
12977     "\n" +\r
12978     "<div class=\"select2-drop select2-with-searchbox select2-drop-auto-width select2-drop-active\" ng-class=\"{'select2-display-none':(!showlist || isDisabled)}\" style=\"width:100%;z-index: 10\">\n" +\r
12979     "    <div class=\"select2-search\">\n" +\r
12980     "        <label ng-if=\"!noFilter\" class=\"select2-offscreen\" aria-label=\"Inline Search Field\" aria-hidden=\"true\">Inline Search Field</label>\n" +\r
12981     "        <input ng-if=\"!noFilter\" ng-model=\"title\" aria-label=\"title\" typeahead=\"c.title for c in cName | filter:$viewValue:startsWith\" type=\"text\" autocomplete=\"off\" autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" class=\"select2-input\" aria-autocomplete=\"list\" placeholder=\"\">\n" +\r
12982     "    </div>\n" +\r
12983     "    <ul id=\"inList\" class=\"select2-results\" role=\"listbox\">\n" +\r
12984     "        <li ng-show=\"filteredName.length === 0\" class=\"select2-no-results\" tabindex=\"-1\">No matches found</li>\n" +\r
12985     "        <li class=\"select2-results-dept-0 select2-result select2-result-selectable\" role=\"presentation\" ng-model=\"ListType\" ng-show=\"selectMsg && filteredName.length > 0\" ng-click=\"selectOption(selectMsg, '-1')\" ng-class=\"{'select2-result-current': selectedOption === selectMsg, 'hovstyle': selectedIndex === -1}\" ng-mouseover=\"hoverIn(-1)\" aria-label=\"{{selectMsg}}\" tabindex=\"-1\">\n" +\r
12986     "            <div ng-if=\"startsWithFilter\" class=\"select2-result-label\" ng-bind-html=\"selectMsg | unsafe\" role=\"option\">\n" +\r
12987     "                <span class=\"select2-match\"></span>\n" +\r
12988     "            </div>\n" +\r
12989     "            <div ng-if=\"!startsWithFilter\" class=\"select2-result-label\" ng-bind-html=\"selectMsg | highlight:title:className | unsafe\" role=\"option\">\n" +\r
12990     "                <span class=\"select2-match\"></span>\n" +\r
12991     "            </div>\n" +\r
12992     "        </li>\n" +\r
12993     "\n" +\r
12994     "        <li role=\"menuitem\" ng-if=\"startsWithFilter\" class=\"select2-results-dept-0 select2-result select2-result-selectable\" role=\"presentation\" ng-model=\"ListType\" ng-repeat=\"(fIndex, item) in filteredName = (cName | startsWith:title:item)\" ng-class=\"{'select2-result-current': selectedOption === item.title,'hovstyle': selectedIndex === item.index,'disable': item.disabled}\" ng-click=\"item.disabled || selectOption(item.title,item.index)\" ng-mouseover=\"hoverIn(item.index)\" aria-label=\"{{item.title}}\" tabindex=\"-1\">\n" +\r
12995     "            <div class=\"select2-result-label\" ng-bind-html=\"item.title | unsafe\" role=\"option\">\n" +\r
12996     "                <span class=\"select2-match\"></span>\n" +\r
12997     "            </div>\n" +\r
12998     "        </li>\n" +\r
12999     "\n" +\r
13000     "        <li role=\"menuitem\" ng-if=\"!startsWithFilter\" class=\"select2-results-dept-0 select2-result select2-result-selectable\" role=\"presentation\" ng-model=\"ListType\" ng-repeat=\"(fIndex, item) in filteredName = (cName | filter:title)\" ng-class=\"{'select2-result-current': selectedOption === item.title,'hovstyle': selectedIndex === item.index,'disable': item.disabled}\" ng-click=\"item.disabled || selectOption(item.title,item.index)\" ng-mouseover=\"hoverIn(item.index)\" aria-label=\"{{item.title}}\" tabindex=\"-1\">\n" +\r
13001     "            <div class=\"select2-result-label\" ng-bind-html=\"item.title | highlight:title:className | unsafe\" role=\"option\">\n" +\r
13002     "                <span class=\"select2-match\"></span>\n" +\r
13003     "            </div>\n" +\r
13004     "        </li>\n" +\r
13005     "    </ul>\n" +\r
13006     "</div>");\r
13007 }]);\r
13008 \r
13009 angular.module("app/scripts/ng_js_att_tpls/select/select.html", []).run(["$templateCache", function($templateCache) {\r
13010   $templateCache.put("app/scripts/ng_js_att_tpls/select/select.html",\r
13011     "<div class=\"select2-container show-search\" ng-class=\"{'select2-dropdown-open': (showlist && !isDisabled),'select2-container-disabled': isDisabled, 'select2-container-active': isact}\" ng-init=\"isact=false;\">\n" +\r
13012     "    <span class=\"select2-choice needsclick\" tabindex=\"{{isDisabled ? -1 : 0}}\" ng-click=\"showDropdown()\" ng-class=\"{'select2-chosen-disabled':isDisabled}\" role=\"combobox\" aria-expanded=\"{{showlist}}\" aria-owns=\"inList\" aria-label=\"{{titleName}} dropdown {{selectedOption}} selected\" ng-focus=\"isact=true;\" ng-blur=\"isact=false;\">\n" +\r
13013     "        <span class=\"select2-chosen needsclick\" aria-hidden=\"true\" ng-bind-html=\"selectedOption | unsafe\">{{selectedOption}}</span>\n" +\r
13014     "        <abbr class=\"select2-search-choice-close needsclick\"></abbr>\n" +\r
13015     "        <span class=\"select2-arrow needsclick\" role=\"presentation\">\n" +\r
13016     "            <b role=\"presentation\" class=\"needsclick\"></b>\n" +\r
13017     "        </span>\n" +\r
13018     "    </span>    \n" +\r
13019     "    <input class=\"select2-focusser select2-offscreen\"            \n" +\r
13020     "           tabindex=\"-1\" \n" +\r
13021     "           type=\"text\" \n" +\r
13022     "           aria-hidden=\"true\" \n" +\r
13023     "           title=\"hidden\"           \n" +\r
13024     "           aria-haspopup=\"true\"           \n" +\r
13025     "           role=\"button\">    \n" +\r
13026     "</div>\n" +\r
13027     "\n" +\r
13028     "<div class=\"select2-drop select2-with-searchbox select2-drop-auto-width select2-drop-active\" ng-class=\"{'select2-display-none':(!showlist || isDisabled)}\" style=\"width:100%;z-index: 10\">\n" +\r
13029     "    <div class=\"select2-search\">\n" +\r
13030     "        <label ng-if=\"!noFilter\" class=\"select2-offscreen\" aria-label=\"Inline Search Field\" aria-hidden=\"true\">Inline Search Field</label>\n" +\r
13031     "        <input ng-if=\"!noFilter\" ng-model=\"title\" aria-label=\"title\" typeahead=\"c.title for c in cName | filter:$viewValue:startsWith\" type=\"text\" autocomplete=\"off\" autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" class=\"select2-input\" aria-autocomplete=\"list\" placeholder=\"\">\n" +\r
13032     "    </div>\n" +\r
13033     "    <ul id=\"inList\" class=\"select2-results\" role=\"listbox\">\n" +\r
13034     "        <li ng-if=\"!noFilter\" ng-show=\"filteredName.length === 0\" class=\"select2-no-results\" tabindex=\"-1\">No matches found</li>\n" +\r
13035     "        <li ng-if=\"!noFilter\" class=\"select2-results-dept-0 select2-result select2-result-selectable\" role=\"presentation\" ng-model=\"ListType\" ng-show=\"selectMsg && filteredName.length > 0\" ng-click=\"selectOption(selectMsg, '-1')\" ng-class=\"{'select2-result-current': selectedOption === selectMsg, 'hovstyle': selectedIndex === -1}\" ng-mouseover=\"hoverIn(-1)\" aria-label=\"{{selectMsg}}\" tabindex=\"-1\">\n" +\r
13036     "            <div ng-if=\"startsWithFilter\" class=\"select2-result-label\" ng-bind-html=\"selectMsg | unsafe\" role=\"option\">\n" +\r
13037     "                <span class=\"select2-match\"></span>\n" +\r
13038     "            </div>\n" +\r
13039     "            <div ng-if=\"!startsWithFilter\" class=\"select2-result-label\" ng-bind-html=\"selectMsg | highlight:title:className | unsafe\" role=\"option\">\n" +\r
13040     "                <span class=\"select2-match\"></span>\n" +\r
13041     "            </div>\n" +\r
13042     "        </li>\n" +\r
13043     "\n" +\r
13044     "        <li  role=\"menuitem\"  ng-if=\"startsWithFilter\" class=\"select2-results-dept-0 select2-result select2-result-selectable\" ng-model=\"ListType\" ng-repeat=\"(fIndex, item) in filteredName = (cName | startsWith:title:item)\" ng-class=\"{'select2-result-current': selectedOption === item.title,'hovstyle': selectedIndex === item.index,'disable': item.disabled}\" ng-click=\"item.disabled || selectOption(item.title,item.index)\" ng-mouseover=\"hoverIn(item.index)\"  tabindex=\"-1\">\n" +\r
13045     "            <div class=\"select2-result-label\" ng-bind-html=\"item.title | unsafe\" role=\"option\">\n" +\r
13046     "                <span class=\"select2-match\"></span>\n" +\r
13047     "            </div>\n" +\r
13048     "        </li>\n" +\r
13049     "\n" +\r
13050     "        <li role=\"menuitem\" ng-if=\"!startsWithFilter\" class=\"select2-results-dept-0 select2-result select2-result-selectable\" ng-model=\"ListType\" ng-repeat=\"(fIndex, item) in filteredName = (cName | filter:title)\" ng-class=\"{'select2-result-current': selectedOption === item.title,'hovstyle': selectedIndex === item.index,'disable': item.disabled}\" ng-click=\"item.disabled || selectOption(item.title,item.index)\" ng-mouseover=\"hoverIn(item.index)\"  tabindex=\"-1\">\n" +\r
13051     "            <div class=\"select2-result-label\" ng-bind-html=\"item.title | highlight:title:className | unsafe\" role=\"option\">\n" +\r
13052     "                <span class=\"select2-match\"></span>\n" +\r
13053     "            </div>\n" +\r
13054     "        </li>\n" +\r
13055     "    </ul>\n" +\r
13056     "</div>");\r
13057 }]);\r
13058 \r
13059 angular.module("app/scripts/ng_js_att_tpls/select/textDropdown.html", []).run(["$templateCache", function($templateCache) {\r
13060   $templateCache.put("app/scripts/ng_js_att_tpls/select/textDropdown.html",\r
13061     "<div tabindex=\"0\" class=\"text-dropdown\">\n" +\r
13062     "   <div class=\"dropdown\" ng-class=\"{'not-visible': isActionsShown}\" ng-click=\"toggle()\">\n" +\r
13063     "           <span class=\"action--selected\" ng-bind=\"currentAction\"></span>\n" +\r
13064     "           <i ng-class=\"isActionsShown ? 'icon-dropdown-up' : 'icon-dropdown-down'\"></i>\n" +\r
13065     "   </div>\n" +\r
13066     "   <ul ng-class=\"isActionsShown ? 'actionsOpened' : 'actionsClosed'\" ng-show=\"isActionsShown\">\n" +\r
13067     "           <li ng-class=\"{'highlight': selectedIndex==$index}\" ng-repeat=\"action in actions track by $index\" ng-click=\"chooseAction($event, action, $index)\" ng-mouseover=\"hoverIn($index)\">{{action}}<i ng-class=\"{'icon-included-checkmark': isCurrentAction(action)}\" att-accessibility-click=\"13,32\"></i></li>\n" +\r
13068     "   </ul>\n" +\r
13069     "</div>");\r
13070 }]);\r
13071 \r
13072 angular.module("app/scripts/ng_js_att_tpls/slider/maxContent.html", []).run(["$templateCache", function($templateCache) {\r
13073   $templateCache.put("app/scripts/ng_js_att_tpls/slider/maxContent.html",\r
13074     "<div class=\"att-slider__label att-slider__label--max att-slider__label--below\" ng-transclude></div>");\r
13075 }]);\r
13076 \r
13077 angular.module("app/scripts/ng_js_att_tpls/slider/minContent.html", []).run(["$templateCache", function($templateCache) {\r
13078   $templateCache.put("app/scripts/ng_js_att_tpls/slider/minContent.html",\r
13079     "<div class=\"att-slider__label att-slider__label--min att-slider__label--below\" ng-transclude></div>");\r
13080 }]);\r
13081 \r
13082 angular.module("app/scripts/ng_js_att_tpls/slider/slider.html", []).run(["$templateCache", function($templateCache) {\r
13083   $templateCache.put("app/scripts/ng_js_att_tpls/slider/slider.html",\r
13084     "<div class=\"att-slider\" ng-mousemove=\"moveElem($event)\" ng-mouseup=\"mouseUp($event)\">\n" +\r
13085     "    <div class=\"att-slider__track\">\n" +\r
13086     "        <div class=\"att-slider__range att-slider__range--disabled\" ng-style=\"disabledStyle\"></div>\n" +\r
13087     "        <div class=\"att-slider__range\" ng-style=\"rangeStyle\"></div>\n" +\r
13088     "    </div>\n" +\r
13089     "    <div class=\"att-slider__handles-container\">\n" +\r
13090     "       <div role=\"menuitem\" aria-label=\"{{ngModelSingle}}\" class=\"att-slider__handle\" ng-style=\"handleStyle\" ng-mousedown=\"mouseDown($event,'ngModelSingle')\" ng-mousemove=\"moveElem($event)\" ng-mouseup=\"mouseUp($event)\" tabindex=\"0\" ng-keydown=\"keyDown($event,'ngModelSingle')\"></div>\n" +\r
13091     "       <div role=\"menuitem\" aria-label=\"Minimum Value- {{ngModelLow}}\" class=\"att-slider__handle\" ng-style=\"minHandleStyle\" ng-mousedown=\"mouseDown($event,'ngModelLow')\" ng-focus=\"focus($event,'ngModelLow')\" ng-mousemove=\"moveElem($event)\" ng-mouseup=\"mouseUp($event)\" tabindex=\"0\" ng-keyup=\"keyUp($event,'ngModelLow')\" ng-keydown=\"keyDown($event,'ngModelLow')\"></div>\n" +\r
13092     "       <div role=\"menuitem\" aria-label=\"Maximum Value- {{ngModelHigh}}\" class=\"att-slider__handle\" ng-style=\"maxHandleStyle\" ng-mousedown=\"mouseDown($event,'ngModelHigh')\" ng-focus=\"focus($event,'ngModelHigh')\" ng-mousemove=\"moveElem($event)\" ng-mouseup=\"mouseUp($event)\" tabindex=\"0\" ng-keyup=\"keyUp($event,'ngModelHigh')\" ng-keydown=\"keyDown($event,'ngModelHigh')\"></div>\n" +\r
13093     "    </div>\n" +\r
13094     "    <div ng-transclude></div>\n" +\r
13095     "</div>");\r
13096 }]);\r
13097 \r
13098 angular.module("app/scripts/ng_js_att_tpls/splitButtonDropdown/splitButtonDropdown.html", []).run(["$templateCache", function($templateCache) {\r
13099   $templateCache.put("app/scripts/ng_js_att_tpls/splitButtonDropdown/splitButtonDropdown.html",\r
13100     "<div class=\" btn-group\" \n" +\r
13101     "     ng-class=\"{'buttons-dropdown--large':!isSmall, \n" +\r
13102     "                 'buttons-dropdown--small':isSmall, \n" +\r
13103     "                 'action-dropdown':(isActionDropdown), \n" +\r
13104     "                 'open':isDropDownOpen}\">\n" +\r
13105     "    <a tabindex=\"0\" href=\"javascript:void(0)\" class=\"button btn buttons-dropdown__split\" \n" +\r
13106     "       ng-class=\"{'button--primary':(btnType==undefined || btnType=='primary'), \n" +\r
13107     "                   'button--secondary':btnType=='secondary', \n" +\r
13108     "                   'button--disabled':btnType=='disabled', \n" +\r
13109     "                   'button--small':isSmall}\" \n" +\r
13110     "       ng-if=\"!isActionDropdown\"\n" +\r
13111     "       ng-click=\"btnType==='disabled'?undefined:clickFxn()\" att-accessibility-click=\"13,32\">{{btnText}}</a>\n" +\r
13112     "    <a tabindex=\"0\" href=\"javascript:void(0)\" role=\"button\" aria-label=\"Toggle Dropdown\" aria-haspopup=\"true\" class=\"button buttons-dropdown__drop dropdown-toggle\" \n" +\r
13113     "       ng-class=\"{'button--primary':(btnType==undefined || btnType=='primary'), \n" +\r
13114     "               'button--secondary':btnType=='secondary', \n" +\r
13115     "               'button--disabled':btnType=='disabled', \n" +\r
13116     "               'button--small':isSmall}\" ng-click=\"toggleDropdown()\" att-accessibility-click=\"13,32\">{{toggleTitle}} </a>\n" +\r
13117     "    <ul class=\"dropdown-menu\" ng-class=\"{'align-right':multiselect ===true}\" aria-expanded=\"{{isDropDownOpen}}\" ng-click=\"hideDropdown()\" role=\"menu\" ng-transclude></ul>\n" +\r
13118     "</div>  ");\r
13119 }]);\r
13120 \r
13121 angular.module("app/scripts/ng_js_att_tpls/splitButtonDropdown/splitButtonDropdownItem.html", []).run(["$templateCache", function($templateCache) {\r
13122   $templateCache.put("app/scripts/ng_js_att_tpls/splitButtonDropdown/splitButtonDropdownItem.html",\r
13123     "<li role=\"menuitem\" att-element-focus=\"sFlag\" tabindex=\"0\" ng-transclude></li>");\r
13124 }]);\r
13125 \r
13126 angular.module("app/scripts/ng_js_att_tpls/splitIconButton/splitIcon.html", []).run(["$templateCache", function($templateCache) {\r
13127   $templateCache.put("app/scripts/ng_js_att_tpls/splitIconButton/splitIcon.html",\r
13128     "<div class='split-icon-button-container'>\n" +\r
13129     "\n" +\r
13130     "   <div class='split-icon-button' ng-class=\"{'icon-with-chevron': isRight && !isMiddle && !isLeftNextDropdown && !isNextToDropDown, 'split-icon-button-middle':isMiddle, 'split-icon-button-right':isRight, 'split-icon-button-left':isLeft, 'split-icon-button-left-dropdown': isLeftNextDropdown ,'split-icon-button-next-dropdown': isNextToDropDown,'split-icon-button-dropdown': isDropDownOpen,'split-icon-button-hover':isIconHovered || isDropDownOpen}\" ng-mouseover='isIconHovered = true;' ng-mouseleave='isIconHovered = false;' tabindex=\"-1\" att-accessibility-click=\"13,32\" ng-click='dropDownClicked();'>\n" +\r
13131     "           <a class='{{icon}}' title='{{iconTitle}}' tabindex=\"0\"></a>\n" +\r
13132     "           <i ng-if=\"isRight && !isMiddle && !isLeftNextDropdown && !isNextToDropDown\" \n" +\r
13133     "                   ng-class=\"isDropDownOpen ? 'icon-dropdown-up' : 'icon-dropdown-down'\"> </i>\n" +\r
13134     "   </div> \n" +\r
13135     "\n" +\r
13136     "    <ul ng-if='isDropdown' class='dropdown-menu {{dropDownId}}' ng-show='\n" +\r
13137     "    isDropDownOpen' ng-click='toggleDropdown(false)' role=\"presentation\" ng-transclude>\n" +\r
13138     "    </ul>\n" +\r
13139     "\n" +\r
13140     "</div>");\r
13141 }]);\r
13142 \r
13143 angular.module("app/scripts/ng_js_att_tpls/splitIconButton/splitIconButton.html", []).run(["$templateCache", function($templateCache) {\r
13144   $templateCache.put("app/scripts/ng_js_att_tpls/splitIconButton/splitIconButton.html",\r
13145     "<div>\n" +\r
13146     "   <div ng-if='isLeftLineShown' dir-type='{{iconStateConstants.DIR_TYPE.LEFT}}' expandable-line></div>\n" +\r
13147     "   <div ng-click='clickHandler()' att-split-icon icon='{{icon}}' title='{{title}}' dir-type='{{iconStateConstants.DIR_TYPE.BUTTON}}' hover-watch='isHovered' drop-down-watch='dropDownWatch' drop-down-id='{{dropDownId}}'>\n" +\r
13148     "           <div ng-transclude>\n" +\r
13149     "           </div>\n" +\r
13150     "   </div>\n" +\r
13151     "   <div ng-if='isRightLineShown' dir-type='{{iconStateConstants.DIR_TYPE.RIGHT}}' expandable-line></div>\n" +\r
13152     "</div>");\r
13153 }]);\r
13154 \r
13155 angular.module("app/scripts/ng_js_att_tpls/splitIconButton/splitIconButtonGroup.html", []).run(["$templateCache", function($templateCache) {\r
13156   $templateCache.put("app/scripts/ng_js_att_tpls/splitIconButton/splitIconButtonGroup.html",\r
13157     "<div ng-transclude>\n" +\r
13158     "</div>");\r
13159 }]);\r
13160 \r
13161 angular.module("app/scripts/ng_js_att_tpls/stepSlider/attStepSlider.html", []).run(["$templateCache", function($templateCache) {\r
13162   $templateCache.put("app/scripts/ng_js_att_tpls/stepSlider/attStepSlider.html",\r
13163     "<span ng-class=\"mainSliderClass\">\n" +\r
13164     "    <table>\n" +\r
13165     "        <tr>\n" +\r
13166     "            <td>\n" +\r
13167     "                <div class=\"jslider-bg\">\n" +\r
13168     "                    <i class=\"l\"></i>\n" +\r
13169     "                    <i class=\"r\"></i>\n" +\r
13170     "                    <i class=\"v\" ng-class=\"{'step-slider-green':sliderColor == COLORS.GREEN, 'step-slider-blue': sliderColor == COLORS.BLUE_HIGHLIGHT, 'step-slider-magenta': sliderColor == COLORS.MAGENTA, 'step-slider-gold': sliderColor == COLORS.GOLD, 'step-slider-purple': sliderColor == COLORS.PURPLE, 'step-slider-dark-blue': sliderColor == COLORS.DARK_BLUE, 'step-slider-regular': sliderColor == COLORS.REGULAR, 'step-slider-white': sliderColor == COLORS.WHITE, 'cutoff-slider': isCutOffSlider}\"></i>\n" +\r
13171     "                </div>\n" +\r
13172     "                <div class=\"jslider-pointer\" id=\"left-pointer\"></div>\n" +\r
13173     "                <div class=\"jslider-pointer jslider-pointer-to\" ng-class=\"{'step-slider-green':sliderColor == COLORS.GREEN, 'step-slider-blue': sliderColor == COLORS.BLUE_HIGHLIGHT, 'step-slider-magenta': sliderColor == COLORS.MAGENTA, 'step-slider-gold': sliderColor == COLORS.GOLD, 'step-slider-purple': sliderColor == COLORS.PURPLE, 'step-slider-dark-blue': sliderColor == COLORS.DARK_BLUE, 'step-slider-regular': sliderColor == COLORS.REGULAR, 'step-slider-white':sliderColor == COLORS.WHITE ,'cutoff-slider': isCutOffSlider}\"></div>\n" +\r
13174     "                <div class=\"jslider-label\"><span ng-bind=\"from\"></span><span ng-bind=\"options.dimension\"></span></div>\n" +\r
13175     "                <div class=\"jslider-label jslider-label-to\"><span ng-bind=\"toStr\"></span><span ng-bind=\"endDimension\"></span></div>\n" +\r
13176     "                <div class=\"jslider-value\" id=\"jslider-value-left\"><span></span>{{options.dimension}}</div>\n" +\r
13177     "                <div class=\"jslider-value jslider-value-to\"><span></span>{{toolTipDimension}}</div>\n" +\r
13178     "                <div class=\"jslider-scale\" ng-class=\"{'show-dividers': showDividers, 'cutoff-slider-dividers':isCutOffSlider}\">\n" +\r
13179     "                </div>\n" +\r
13180     "                <div class=\"jslider-cutoff\">\n" +\r
13181     "                    <div class=\"jslider-label jslider-label-cutoff\">\n" +\r
13182     "                        <span ng-bind=\"cutOffVal\"></span>\n" +\r
13183     "                    </div>\n" +\r
13184     "                </div>\n" +\r
13185     "            </td>\n" +\r
13186     "        </tr>\n" +\r
13187     "    </table>\n" +\r
13188     "</span>\n" +\r
13189     "");\r
13190 }]);\r
13191 \r
13192 angular.module("app/scripts/ng_js_att_tpls/steptracker/step-tracker.html", []).run(["$templateCache", function($templateCache) {\r
13193   $templateCache.put("app/scripts/ng_js_att_tpls/steptracker/step-tracker.html",\r
13194     "<div class=\"steptracker1\">\n" +\r
13195     "    <div class=\"steptracker-bg\">\n" +\r
13196     "        <div tabindex=\"0\" ng-click=\"stepclick($event, $index);\" att-accessibility-click=\"13,23\" class=\"steptracker-track size-onethird\" ng-repeat=\"step in sdata\"\n" +\r
13197     "             ng-style=\"set_width($index)\"\n" +\r
13198     "             ng-class=\"{'last':laststep($index),'done':donesteps($index),'active':activestep($index), 'incomplete': isIncomplete($index), 'disabled': disableClick}\">\n" +\r
13199     "            <div class=\"circle\">{{($index) + 1}}<span>{{step.title}}</span></div>\n" +\r
13200     "            <div ng-if=\"!laststep($index)\" class=\"track\"></div>\n" +\r
13201     "        </div>\n" +\r
13202     "    </div>\n" +\r
13203     "</div>");\r
13204 }]);\r
13205 \r
13206 angular.module("app/scripts/ng_js_att_tpls/steptracker/step.html", []).run(["$templateCache", function($templateCache) {\r
13207   $templateCache.put("app/scripts/ng_js_att_tpls/steptracker/step.html",\r
13208     "<div class=\"steptracker1\">\n" +\r
13209     "    <div class=\"steptracker-bg\">\n" +\r
13210     "        <div class=\"steptracker-track size-onethird\" \n" +\r
13211     "             ng-class=\"{'last':laststep($index),'done':donesteps($index),'active':activestep($index)}\">\n" +\r
13212     "            <div class=\"circle\" tabindex=\"0\" \n" +\r
13213     "                 ng-click=\"stepclick($event, $index);\" \n" +\r
13214     "                 att-accessibility-click=\"13,23\">{{($index) + 1}}<span>{{step.title}}</span></div>\n" +\r
13215     "            <div ng-if=\"!laststep($index)\" class=\"track\"></div>\n" +\r
13216     "        </div>\n" +\r
13217     "    </div>\n" +\r
13218     "</div>\n" +\r
13219     "");\r
13220 }]);\r
13221 \r
13222 angular.module("app/scripts/ng_js_att_tpls/steptracker/timeline.html", []).run(["$templateCache", function($templateCache) {\r
13223   $templateCache.put("app/scripts/ng_js_att_tpls/steptracker/timeline.html",\r
13224     "<div class='att-timeline'>\n" +\r
13225     "   <div timeline-dot order='0' title='{{steps[0].title}}' description='{{steps[0].description}}' by='{{steps[0].by}}' date='{{steps[0].date}}' type='{{steps[0].type}}'></div>\n" +\r
13226     "\n" +\r
13227     "   <div ng-repeat=\"m in middleSteps track by $index\">\n" +\r
13228     "           <div timeline-bar order='{{$index}}'></div>\n" +\r
13229     "           <div timeline-dot order='{{$index + 1}}' title='{{m.title}}' description='{{m.description}}' by='{{m.by}}' date='{{m.date}}' type='{{m.type}}'>\n" +\r
13230     "           </div>\n" +\r
13231     "   </div>\n" +\r
13232     "\n" +\r
13233     "</div>");\r
13234 }]);\r
13235 \r
13236 angular.module("app/scripts/ng_js_att_tpls/steptracker/timelineBar.html", []).run(["$templateCache", function($templateCache) {\r
13237   $templateCache.put("app/scripts/ng_js_att_tpls/steptracker/timelineBar.html",\r
13238     "<div class='timeline-bar'>\n" +\r
13239     "   <div class='progress-bar' ng-class=\"{'completed-color':isCompleted,'cancelled-color':isCancelled,'alert-color':isAlert}\">\n" +\r
13240     "   </div>\n" +\r
13241     "   <hr></hr>\n" +\r
13242     "</div>");\r
13243 }]);\r
13244 \r
13245 angular.module("app/scripts/ng_js_att_tpls/steptracker/timelineDot.html", []).run(["$templateCache", function($templateCache) {\r
13246   $templateCache.put("app/scripts/ng_js_att_tpls/steptracker/timelineDot.html",\r
13247     "<div class='timeline-dot'>\n" +\r
13248     "\n" +\r
13249     "   <div class='bigger-circle' ng-class=\"{'completed-color':isCompleted,'cancelled-color':isCancelled,'alert-color':isAlert}\">\n" +\r
13250     "   </div>\n" +\r
13251     "\n" +\r
13252     "   <div class='inactive-circle'>\n" +\r
13253     "   </div>\n" +\r
13254     "\n" +\r
13255     "   <div class='expandable-circle' ng-class=\"{'completed-color':isCompleted,'cancelled-color':isCancelled,'alert-color':isAlert}\">\n" +\r
13256     "   </div>\n" +\r
13257     "\n" +\r
13258     "   <div ng-class=\"{'below-info-box':isBelowInfoBoxShown, 'above-info-box': !isBelowInfoBoxShown}\" tabindex=\"0\">\n" +\r
13259     "           \n" +\r
13260     "           <div ng-if='isBelowInfoBoxShown' class='vertical-line'>\n" +\r
13261     "           </div>\n" +\r
13262     "\n" +\r
13263     "           <div class='info-container' ng-init='isContentShown=false'>\n" +\r
13264     "                   <div ng-class=\"{'current-step-title':isCurrentStep, 'title':!isCurrentStep,'completed-color-text':isCompleted,'cancelled-color-text':isCancelled,'alert-color-text':isAlert, 'inactive-color-text':isInactive}\" ng-mouseover='titleMouseover(1)' ng-mouseleave='titleMouseleave()' ng-bind='title' ></div>\n" +\r
13265     "                   <div class='content'>\n" +\r
13266     "                           <div class='description' ng-bind='description'></div>\n" +\r
13267     "                           <div class='submitter' ng-bind='by'></div>\n" +\r
13268     "                   </div>\n" +\r
13269     "                   <div class='date' ng-mouseover='titleMouseover(2)' ng-mouseleave='titleMouseleave()' ng-bind='date'></div>\n" +\r
13270     "           </div>\n" +\r
13271     "\n" +\r
13272     "           <div ng-if='!isBelowInfoBoxShown' class='vertical-line'>\n" +\r
13273     "           </div>\n" +\r
13274     "   </div>\n" +\r
13275     "\n" +\r
13276     "</div>");\r
13277 }]);\r
13278 \r
13279 angular.module("app/scripts/ng_js_att_tpls/table/attTable.html", []).run(["$templateCache", function($templateCache) {\r
13280   $templateCache.put("app/scripts/ng_js_att_tpls/table/attTable.html",\r
13281     "<table class=\"tablesorter tablesorter-default\" ng-transclude></table>\n" +\r
13282     "");\r
13283 }]);\r
13284 \r
13285 angular.module("app/scripts/ng_js_att_tpls/table/attTableBody.html", []).run(["$templateCache", function($templateCache) {\r
13286   $templateCache.put("app/scripts/ng_js_att_tpls/table/attTableBody.html",\r
13287     "<td ng-transclude></td>\n" +\r
13288     "");\r
13289 }]);\r
13290 \r
13291 angular.module("app/scripts/ng_js_att_tpls/table/attTableHeader.html", []).run(["$templateCache", function($templateCache) { \r
13292   $templateCache.put("app/scripts/ng_js_att_tpls/table/attTableHeader.html", \r
13293     "<th role=\"columnheader\" scope=\"col\" aria-live=\"polite\" aria-sort=\"{{sortPattern !== 'null' && '' || sortPattern}}\" aria-label=\"{{headerName}} {{sortable !== 'false' && ': activate to sort' || ' '}} {{sortPattern !== 'null' && '' || sortPattern}}\" tabindex=\"{{sortable !== 'false' && '0' || '-1'}}\" class=\"tablesorter-header\" ng-class=\"{'tablesorter-headerAsc': sortPattern === 'ascending', 'tablesorter-headerDesc': sortPattern === 'descending', 'tablesort-sortable': sortable !== 'false', 'sorter-false': sortable === 'false'}\" att-accessibility-click=\"13,32\" ng-click=\"(sortable !== 'false') && sort();\"><div class=\"tablesorter-header-inner\" ng-transclude></div></th>"); \r
13294 }]);\r
13295 \r
13296 angular.module("app/scripts/ng_js_att_tpls/tableMessages/attTableMessage.html", []).run(["$templateCache", function($templateCache) {\r
13297   $templateCache.put("app/scripts/ng_js_att_tpls/tableMessages/attTableMessage.html",\r
13298     "<div class=\"att-table-message\">\n" +\r
13299     "   <div class=\"message\" ng-if=\"msgType==messageConstants.TABLE_MESSAGE_TYPES.noMatching\">\n" +\r
13300     "      <div class=\"img-magnify-glass\"></div> \n" +\r
13301     "      <div>\n" +\r
13302     "         <div ng-transclude></div>\n" +\r
13303     "      </div>\n" +\r
13304     "   </div>\n" +\r
13305     "   <div class=\"message\" ng-if=\"msgType==messageConstants.TABLE_MESSAGE_TYPES.errorLoading\">\n" +\r
13306     "      <div class=\"img-oops-exclamation\" tabindex=\"0\" aria-label=\"Oops! The information could not load at this time. Please click link to refresh the page.\"></div> \n" +\r
13307     "      <div>Oops!</div>\n" +\r
13308     "      <div>The information could not load at this time.</div>\n" +\r
13309     "      <div>Please <a href=\"javascript:void(0)\" ng-click=\"refreshAction($event)\">refresh the page</a>\n" +\r
13310     "      </div>\n" +\r
13311     "   </div>\n" +\r
13312     "   <div class=\"message\" ng-if=\"msgType==messageConstants.TABLE_MESSAGE_TYPES.magnifySearch\">\n" +\r
13313     "      <div class=\"img-magnify-glass\"></div>\n" +\r
13314     "      <div>\n" +\r
13315     "         <p class=\"title\" tabindex=\"0\">Please input values to <br/> begin your search.</p>\n" +\r
13316     "      </div>\n" +\r
13317     "   </div>\n" +\r
13318     "   <div class=\"message loading-message\" ng-if=\"msgType==messageConstants.TABLE_MESSAGE_TYPES.isLoading\">\n" +\r
13319     "      <div class=\"img-loading-dots\"></div>\n" +\r
13320     "      <div ng-transclude></div>\n" +\r
13321     "   </div>\n" +\r
13322     "</div>");\r
13323 }]);\r
13324 \r
13325 angular.module("app/scripts/ng_js_att_tpls/tableMessages/attUserMessage.html", []).run(["$templateCache", function($templateCache) {\r
13326   $templateCache.put("app/scripts/ng_js_att_tpls/tableMessages/attUserMessage.html",\r
13327     "<div class=\"att-user-message\">\n" +\r
13328     "  <div ng-class=\"type==messageConstants.USER_MESSAGE_TYPES.error && trigger ? 'message-wrapper-error' : 'hidden'\">\n" +\r
13329     "      <div class=\"message-icon-error\"> <i class=\"icon-info-alert\"></i> </div>\n" +\r
13330     "\n" +\r
13331     "      <div class=\"message-body-wrapper\">\n" +\r
13332     "        <div class=\"message-title-error\" ng-if=\"thetitle && thetitle.length > 0\"> <span ng-bind=\"thetitle\" tabindex=\"0\" aria-label=\"{{thetitle}}\"></span> </div>\n" +\r
13333     "        <div class=\"message-msg\" ng-bind=\"message\" ng-if=\"message && message.length > 0\" tabindex=\"0\"></div>\n" +\r
13334     "        <div class=\"message-bottom\">\n" +\r
13335     "           <div ng-transclude></div>\n" +\r
13336     "        </div>\n" +\r
13337     "      </div>\n" +\r
13338     "\n" +\r
13339     "   </div>\n" +\r
13340     "  <div ng-class=\"type==messageConstants.USER_MESSAGE_TYPES.success && trigger ? 'message-wrapper-success' : 'hidden'\">\n" +\r
13341     "      <div class=\"message-icon-success\"> <i class=\"icon-included-checkmark\"></i></div>\n" +\r
13342     "\n" +\r
13343     "      <div class=\"message-body-wrapper\">\n" +\r
13344     "        <div class=\"message-title-success\" ng-if=\"thetitle && thetitle.length > 0\" >\n" +\r
13345     "          <span ng-bind=\"thetitle\" tabindex=\"0\" aria-label=\"{{thetitle}}\"></span>\n" +\r
13346     "        </div>\n" +\r
13347     "        <div class=\"message-msg\" ng-bind=\"message\" ng-if=\"message && message.length > 0\" tabindex=\"0\"></div>\n" +\r
13348     "        <div class=\"message-bottom\">\n" +\r
13349     "           <div ng-transclude></div>\n" +\r
13350     "        </div>\n" +\r
13351     "      </div>\n" +\r
13352     "\n" +\r
13353     "   </div>\n" +\r
13354     "</div>\n" +\r
13355     "");\r
13356 }]);\r
13357 \r
13358 angular.module("app/scripts/ng_js_att_tpls/tabs/floatingTabs.html", []).run(["$templateCache", function($templateCache) {\r
13359   $templateCache.put("app/scripts/ng_js_att_tpls/tabs/floatingTabs.html",\r
13360     "<ul ng-class=\"{'tabsbid': size === 'large', 'tabsbid--small': size === 'small'}\">\n" +\r
13361     " <li ng-repeat=\"tab in tabs\" ng-class=\"{'tabsbid__item tabsbid__item--active': isActiveTab(tab.url), 'tabsbid__item': !isActiveTab(tab.url)}\" ng-click=\"onClickTab(tab)\">\n" +\r
13362     "        <a class=\"tabsbid__item-link\" href=\"{{tab.url}}\" tabindex=\"0\" att-accessibility-click=\"32,13\">{{tab.title}}</a>\n" +\r
13363     "  </li>\n" +\r
13364     "</ul>");\r
13365 }]);\r
13366 \r
13367 angular.module("app/scripts/ng_js_att_tpls/tabs/genericTabs.html", []).run(["$templateCache", function($templateCache) {\r
13368   $templateCache.put("app/scripts/ng_js_att_tpls/tabs/genericTabs.html",\r
13369     "<ul ng-class=\"{'tabsbid': size === 'large', 'tabsbid--small': size === 'small'}\">\n" +\r
13370     "    <li ng-repeat=\"tab in tabs\" ng-class=\"{'tabsbid__item tabsbid__item--active': isActive(tab.id), 'tabsbid__item': !isActive(tab.id),'tabs__item--active': isActive(tab.id)}\" ng-click=\"clickTab(tab)\">\n" +\r
13371     "           <a class=\"tabsbid__item-link\" href=\"{{tab.url}}\" tabindex=\"0\" att-accessibility-click=\"32,13\">{{tab.title}}</a>\n" +\r
13372     "    </li>\n" +\r
13373     "</ul>\n" +\r
13374     "");\r
13375 }]);\r
13376 \r
13377 angular.module("app/scripts/ng_js_att_tpls/tabs/menuTab.html", []).run(["$templateCache", function($templateCache) {\r
13378   $templateCache.put("app/scripts/ng_js_att_tpls/tabs/menuTab.html",\r
13379     "<li class=\"megamenu__item\" ng-mouseover=\"showHoverChild($event)\" ng-class=\"{'tabs__item--active': menuItem.active==true && !hoverChild==true}\">\n" +\r
13380     "    <span role=\"menuitem\" att-accessibility-click=\"13,32\" tabindex=\"0\" ng-click=\"showChildren($event);!clickInactive||resetMenu($event)\">{{tabName}}</span>\n" +\r
13381     "    <div ng-transclude></div>\n" +\r
13382     "</li>\n" +\r
13383     "");\r
13384 }]);\r
13385 \r
13386 angular.module("app/scripts/ng_js_att_tpls/tabs/parentmenuTab.html", []).run(["$templateCache", function($templateCache) {\r
13387   $templateCache.put("app/scripts/ng_js_att_tpls/tabs/parentmenuTab.html",\r
13388     "<div ng-class=\"{'megamenu-tabs': megaMenu,'submenu-tabs': !megaMenu}\">\n" +\r
13389     "    <ul class=\"megamenu__items\" role=\"presentation\" ng-transclude>\n" +\r
13390     "    </ul>\n" +\r
13391     "</div>");\r
13392 }]);\r
13393 \r
13394 angular.module("app/scripts/ng_js_att_tpls/tabs/simplifiedTabs.html", []).run(["$templateCache", function($templateCache) {\r
13395   $templateCache.put("app/scripts/ng_js_att_tpls/tabs/simplifiedTabs.html",\r
13396     "<div class=\"simplified-tabs\">\n" +\r
13397     "<ul class=\"simplified-tabs__items\" role=\"tablist\">\n" +\r
13398     "    <li ng-repeat=\"tab in tabs\" role=\"tab\" class=\"simplified-tabs__item\" ng-class=\"{'tabs__item--active': isActive(tab.id)}\" ng-click=\"clickTab(tab)\" tabindex=\"0\" att-accessibility-click=\"32,13\">{{tab.title}}</li>\n" +\r
13399     "    <li class=\"tabs__pointer\"></li>\n" +\r
13400     "</ul>\n" +\r
13401     "</div>");\r
13402 }]);\r
13403 \r
13404 angular.module("app/scripts/ng_js_att_tpls/tabs/submenuTab.html", []).run(["$templateCache", function($templateCache) {\r
13405   $templateCache.put("app/scripts/ng_js_att_tpls/tabs/submenuTab.html",\r
13406     "<li class=\"tabsbid__item megamenu__item\" ng-class=\"{'subMenuHover': menuItem.active==true}\">\n" +\r
13407     "<a ng-href=\"{{tabUrl}}\" role=\"menuitem\" ng-if=\"subMenu === true\" ng-mouseover=\"!subMenu || showChildren($event)\" ng-focus=\"!subMenu ||showChildren($event)\" tabindex=\"{{subMenu=='true'?0:-1}}\" ng-click=\"!subMenu ||showMenuClick($event) ; subMenu ||showSubMenuClick($event)\" att-accessibility-click=\"13,32\">{{tabName}}</a>\n" +\r
13408     "<a  ng-href=\"{{tabUrl}}\" role=\"menuitem\" ng-if=\"!menuItem.leafNode && subMenu !== true\" ng-mouseover=\"!subMenu || showChildren($event)\" ng-focus=\"!subMenu ||showChildren($event)\" tabindex=\"{{subMenu=='true'?0:-1}}\" ng-click=\"!subMenu ||showMenuClick($event) ; subMenu ||showSubMenuClick($event)\" att-accessibility-click=\"13,32\">{{tabName}}</a>\n" +\r
13409     "<span ng-transclude></span>\n" +\r
13410     "</li>\n" +\r
13411     "");\r
13412 }]);\r
13413 \r
13414 angular.module("app/scripts/ng_js_att_tpls/tagBadges/tagBadges.html", []).run(["$templateCache", function($templateCache) {\r
13415   $templateCache.put("app/scripts/ng_js_att_tpls/tagBadges/tagBadges.html",\r
13416     "<div class=\"tags__item\" \n" +\r
13417     "     ng-class=\"{'tags__item--small':isSmall, \n" +\r
13418     "                 'tags__item--color':isColor, \n" +\r
13419     "                 'tags__item--cloud':!isClosable && !isColor,'active':applyActiveClass}\"\n" +\r
13420     "     ng-if=\"display\" \n" +\r
13421     "     ng-style=\"{borderColor: border_type_borderColor, background: isHighlight?'#bbb':undefined, color: isHighlight?'#444':undefined }\"\n" +\r
13422     "     ng-mousedown=\"activeHighlight(true)\" role=\"presentation\" ng-mouseup=\"activeHighlight(false)\">\n" +\r
13423     "    <i class=\"icon-filter tags__item--icon\" ng-if=\"isIcon\">&nbsp;</i>\n" +\r
13424     "    <i class=\"tags__item--color-icon\" ng-if=\"isColor\" ng-style=\"{backgroundColor: background_type_backgroundColor, borderColor: background_type_borderColor}\"></i>\n" +\r
13425     "    <span class=\"tags__item--title\" role=\"presentation\"  tabindex=0  ng-mousedown=\"activeHighlight(true)\" ng-mouseup=\"activeHighlight(false)\" ng-transclude></span>\n" +\r
13426     "    <a href=\"javascript:void(0)\" title=\"Dismiss Link\" class=\"tags__item--action\" ng-click=\"closeMe();$event.preventDefault()\" ng-if=\"isClosable\"\n" +\r
13427     "       ng-style=\"{color: (isHighlight && '#444') || '#888' , borderLeft: (isHighlight && '1px solid #444')|| '1px solid #888' }\">\n" +\r
13428     "        <i class=\"icon-erase\">&nbsp;</i>\n" +\r
13429     "    </a>\n" +\r
13430     "</div>");\r
13431 }]);\r
13432 \r
13433 angular.module("app/scripts/ng_js_att_tpls/toggle/demoToggle.html", []).run(["$templateCache", function($templateCache) {\r
13434   $templateCache.put("app/scripts/ng_js_att_tpls/toggle/demoToggle.html",\r
13435     "<span ng-transclude></span>\n" +\r
13436     "<div class=\"att-switch-content\" hm-drag = \"drag($event)\" att-accessibility-click=\"13,32\" ng-click=\"updateModel($event)\" hm-dragstart=\"alert('hello')\" hm-dragend=\"drag($event)\" ng-class=\"{'large' : directiveValue == 'large'}\"  style=\"-webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\">\n" +\r
13437     "    <div class=\"att-switch-onText\" ng-style=\"\" ng-class=\"{'icon-included-checkmark ico' : on === undefined,'large' : directiveValue == 'large'}\">{{on}}<span class=\"hidden-spoken\">{{directiveValue}} when checked.</span></div>\n" +\r
13438     "    <div class=\"att-switch-thumb\" tabindex=\"0\" title=\"Toggle switch\" role=\"checkbox\"  ng-class=\"{'large' : directiveValue == 'large'}\"></div>\n" +\r
13439     "    <div class=\"att-switch-offText\" ng-class=\"{'icon-erase ico' : on === undefined,'large' : directiveValue == 'large'}\">{{off}}<span class=\"hidden-spoken\">{{directiveValue}} when unchecked.</span></div>\n" +\r
13440     "</div>\n" +\r
13441     "");\r
13442 }]);\r
13443 \r
13444 angular.module("app/scripts/ng_js_att_tpls/typeAhead/typeAhead.html", []).run(["$templateCache", function($templateCache) {\r
13445   $templateCache.put("app/scripts/ng_js_att_tpls/typeAhead/typeAhead.html",\r
13446     "<div class=\"typeahead mainContainerOuter\">\n" +\r
13447     "    <span class=\"message\">To</span>\n" +\r
13448     "    <div class='maincontainer' ng-click=\"setFocus()\" ng-focus=\"inputActive=true\" ng-class =\"{'typeahed_active':inputActive || (lineItems.length && inputActive)}\">\n" +\r
13449     "        <span tag-badges closable ng-repeat =\"lineItem in lineItems track by $index\" on-close=\"theMethodToBeCalled($index)\" >{{lineItem}}</span>\n" +\r
13450     "        <input type=\"text\"  focus-me=\"clickFocus\" ng-focus=\"inputActive=true\" ng-model=\"model\" ng-keydown=\"selected = false; selectionIndex($event)\"/><br/> \n" +\r
13451     "    </div>\n" +\r
13452     "    <div ng-hide=\"!model.length || selected\">\n" +\r
13453     "        <div class=\"filtercontainer list-scrollable\" ng-show=\"( items | filter:model).length\">\n" +\r
13454     "            <div  class=\"item\" ng-repeat=\"item in items| filter:model track by $index\"  ng-click=\"handleSelection(item[titleName],item[subtitle])\" att-accessibility-click=\"13,32\" ng-class=\"{active:isCurrent($index,item[titleName],item[subtitle],( items | filter:model).length)}\"ng-mouseenter=\"setCurrent($index)\">\n" +\r
13455     "                <span class=\"title\" >{{item[titleName]}}</span>\n" +\r
13456     "                <span class=\"subtitle\">{{item[subtitle]}}</span>\n" +\r
13457     "            </div>  \n" +\r
13458     "        </div>\n" +\r
13459     "    </div>\n" +\r
13460     "   \n" +\r
13461     "    <div class=\"textAreaEmailContentDiv\">\n" +\r
13462     "        <span class=\"message\">Message</span>\n" +\r
13463     "        <textarea rows=\"4\" cols=\"50\" role=\"textarea\" class=\"textAreaEmailContent\" ng-model=\"emailMessage\">To send \n" +\r
13464     " a text, picture, or video message1 to an AT&T wireless device from your email:my message.</textarea>\n" +\r
13465     "        \n" +\r
13466     "    </div>\n" +\r
13467     "    \n" +\r
13468     "</div>\n" +\r
13469     "");\r
13470 }]);\r
13471 \r
13472 angular.module("app/scripts/ng_js_att_tpls/verticalSteptracker/vertical-step-tracker.html", []).run(["$templateCache", function($templateCache) {\r
13473   $templateCache.put("app/scripts/ng_js_att_tpls/verticalSteptracker/vertical-step-tracker.html",\r
13474     "<li>\n" +\r
13475     "    <i ng-class=\"{'icon-tickets-active' : type == 'actual' && id =='Active','icon-tickets-referred' : type == 'actual' && id =='Requested Closed','icon-ticket-regular' : type == 'progress' && id =='In Progress','icon-tickets-contested' : type == 'actual' && id =='Contested','icon-tickets-returned' : type == 'actual' && id =='Deferred','icon-tickets-closed' : type == 'actual' && id =='Ready to Close','icon-tickets-cleared' : type == 'actual' && id =='Cleared'}\"></i>\n" +\r
13476     "    <span ng-transclude></span>\n" +\r
13477     "</li>\n" +\r
13478     "        \n" +\r
13479     "");\r
13480 }]);\r
13481 \r
13482 angular.module("app/scripts/ng_js_att_tpls/videoControls/photoControls.html", []).run(["$templateCache", function($templateCache) {\r
13483   $templateCache.put("app/scripts/ng_js_att_tpls/videoControls/photoControls.html",\r
13484     "<div>\n" +\r
13485     "    <a title=\"{{links.prevLink}}\" aria-label=\"Previous Link\"  ng-href=\"{{links.prevLink}}\"><i alt=\"previous\" class=\"icon-arrow-left\">&nbsp;</i></a>\n" +\r
13486     "    <span ng-transclude></span>\n" +\r
13487     "    <a title=\"{{links.nextLink}}\" aria-label=\"Next Link\"  ng-href=\"{{links.nextLink}}\"><i alt=\"next\" class=\"icon-arrow-right\">&nbsp;</i></a>\n" +\r
13488     "</div>");\r
13489 }]);\r
13490 \r
13491 angular.module("app/scripts/ng_js_att_tpls/videoControls/videoControls.html", []).run(["$templateCache", function($templateCache) {\r
13492   $templateCache.put("app/scripts/ng_js_att_tpls/videoControls/videoControls.html",\r
13493     "<div class=\"video-player\">\n" +\r
13494     "    <div class=\"video-player__control video-player__play-button\">\n" +\r
13495     "        <a class=\"video-player__button gigant-play\" data-toggle-buttons=\"icon-play, icon-pause\" data-target=\"i\"><i class=\"icon-play\"  alt=\"Play/Pause Button\"></i></a>\n" +\r
13496     "    </div>\n" +\r
13497     "    <div class=\"video-player__control video-player__track\">\n" +\r
13498     "\n" +\r
13499     "        <div class=\"video-player__track--inner\">\n" +\r
13500     "            <div class=\"video-player__track--loaded\" style=\"width: 75%\"></div>\n" +\r
13501     "            <div class=\"video-player__track--played\" style=\"width: 40%\">\n" +\r
13502     "                <div class=\"att-tooltip att-tooltip--on att-tooltip--dark att-tooltip--above video-player__track-tooltip\" ng-transclude></div>\n" +\r
13503     "                <div class=\"video-player__track-handle\"></div>\n" +\r
13504     "            </div>\n" +\r
13505     "        </div>\n" +\r
13506     "    </div>\n" +\r
13507     "    <a class=\"video-player__time\" ng-transclude></a>\n" +\r
13508     "    <div class=\"video-player__control video-player__volume_icon\">\n" +\r
13509     "        <a class=\"video-player__button\" data-toggle-buttons=\"icon-volume-mute, icon-volume-up\" data-target=\"i\"><i class=\"icon-volume-up\" alt=\"Volume Button\"></i></a>\n" +\r
13510     "    </div>\n" +\r
13511     "    <ul class=\"video-player__control video-player__volume\">\n" +\r
13512     "        <li class=\"video-player__volume-bar video-player__volume-bar--full\">&nbsp;</li>\n" +\r
13513     "        <li class=\"video-player__volume-bar video-player__volume-bar--full\">&nbsp;</li>\n" +\r
13514     "        <li class=\"video-player__volume-bar\">&nbsp;</li>\n" +\r
13515     "        <li class=\"video-player__volume-bar\">&nbsp;</li>\n" +\r
13516     "        <li class=\"video-player__volume-bar\">&nbsp;</li>\n" +\r
13517     "    </ul>\n" +\r
13518     "    <div class=\"video-player__control video-player__toggle-fullscreen-button\">\n" +\r
13519     "        <a class=\"video-player__button\" data-toggle-buttons=\"icon-full-screen, icon-normal-screen\" data-target=\"i\"><i class=\"icon-full-screen\" alt=\"Full Screen Button\">&nbsp;</i></a>\n" +\r
13520     "    </div>\n" +\r
13521     "</div>");\r
13522 }]);\r
13523 \r
13524 return {}\r
13525 })(angular, window);