2 * FileName att-style-guide
\r
4 * Build number 5c64ecd381d5984c483cdfaa078a1890
\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
13 .filter('unsafe',[ '$sce', function ($sce) {
\r
14 return function(val){
\r
15 return $sce.trustAsHtml(val);
\r
19 .filter('highlight', function () {
\r
20 function escapeRegexp(queryToEscape) {
\r
21 return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
\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
28 .filter('attLimitTo', function() {
\r
29 return function(actualArray, _limit, _begin) {
\r
30 var finalArray = [];
\r
36 if(actualArray && !isNaN(limit)) {
\r
37 finalArray = actualArray.slice(begin, begin+limit);
\r
39 finalArray = actualArray;
\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
53 return function(items, searchString) {
\r
54 if (searchString === undefined || searchString === "") {
\r
59 angular.forEach(items, function(item) {
\r
60 if (item.title.toLowerCase().startsWith(searchString.toLowerCase())) {
\r
61 filtered.push(item);
\r
68 .directive('attInputDeny', [function() {
\r
72 link: function (scope, elem, attr, ctrl) {
\r
73 var regexExpression = null;
\r
74 attr.$observe('attInputDeny', function (value) {
\r
76 regexExpression = new RegExp(value, 'g');
\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
91 .directive('attAccessibilityClick', [function() {
\r
94 link: function (scope, elem, attr) {
\r
96 attr.$observe('attAccessibilityClick', function (value) {
\r
98 keyCode = value.split(',');
\r
101 elem.bind('keydown', function (ev) {
\r
102 var keyCodeCondition = function(){
\r
106 ev.keyCode = ev.which;
\r
108 else if(ev.charCode){
\r
109 ev.keyCode = ev.charCode;
\r
112 if((ev.keyCode && keyCode.indexOf(ev.keyCode.toString()) > -1)){
\r
117 if(keyCode.length > 0 && keyCodeCondition()) {
\r
119 ev.preventDefault();
\r
126 .directive('attElementFocus', [function() {
\r
129 link: function(scope, elem, attr) {
\r
130 scope.$watch(attr.attElementFocus, function (value) {
\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
148 link: function (scope, element, attrs) {
\r
149 checkDirectivePrerequisites(attrs);
\r
151 scope.$watch(attrs.focusOn, function (currentValue) {
\r
153 $timeout(function () {
\r
154 element[0].focus();
\r
162 .constant('whenScrollEndsConstants', {
\r
167 .directive('whenScrollEnds', function(whenScrollEndsConstants, $log) {
\r
170 link: function (scope, element, attrs) {
\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
178 var threshold = parseInt(attrs.threshold, 10) || whenScrollEndsConstants.threshold;
\r
180 if (!attrs.axis || attrs.axis === '') {
\r
181 $log.warn('axis attribute must be defined for whenScrollEnds.');
\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
191 element[0].addEventListener('scroll', function() {
\r
192 var scrollableWidth = element.prop('scrollWidth');
\r
193 if (scrollableWidth === undefined) {
\r
194 scrollableWidth = 1;
\r
196 var hiddenContentWidth = scrollableWidth - visibleWidth;
\r
198 if (hiddenContentWidth - element[0].scrollLeft <= threshold) {
\r
199 /* Scroll almost at bottom, load more rows */
\r
200 scope.$apply(attrs.whenScrollEnds);
\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
209 element[0].addEventListener('scroll', function() {
\r
210 var scrollableHeight = element.prop('scrollHeight');
\r
211 if (scrollableHeight === undefined) {
\r
212 scrollableHeight = 1;
\r
214 var hiddenContentHeight = scrollableHeight - visibleHeight;
\r
216 if (hiddenContentHeight - element[0].scrollTop <= threshold) {
\r
217 /* Scroll almost at bottom, load more rows */
\r
218 scope.$apply(attrs.whenScrollEnds);
\r
226 .directive("validImei", function(){
\r
229 require: 'ngModel',
\r
230 link: function(scope, ele, attrs, ctrl)
\r
232 ctrl.$parsers.unshift(function(value)
\r
235 scope.valid = false;
\r
236 if (!isNaN(value) && value.length === 15)
\r
238 var sumImeiVal = 0;
\r
240 for (var imeiIndex=0; imeiIndex<15; imeiIndex++)
\r
242 posIMEI[imeiIndex] = parseInt(value.substring(imeiIndex,imeiIndex + 1),10);
\r
243 if (imeiIndex % 2 !== 0)
\r
245 posIMEI[imeiIndex] = parseInt((posIMEI[imeiIndex] * 2),10);
\r
247 if (posIMEI[imeiIndex] > 9)
\r
249 posIMEI[imeiIndex] = parseInt((posIMEI[imeiIndex] % 10),10) + parseInt((posIMEI[imeiIndex] / 10),10);
\r
251 sumImeiVal=sumImeiVal+parseInt((posIMEI[imeiIndex]),10);
\r
254 if((sumImeiVal % 10) === 0)
\r
256 scope.valid = true;
\r
260 scope.valid = false;
\r
265 scope.valid = false;
\r
267 ctrl.$setValidity('invalidImei', scope.valid);
\r
269 return scope.valid ? value : undefined;
\r
275 .directive("togglePassword", function(){
\r
279 link: function(scope, element, attr, ctrl)
\r
281 element.bind("click", function()
\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
294 .factory('events', function(){
\r
295 var _stopPropagation = function(evt){
\r
296 if(evt.stopPropagation) {
\r
297 evt.stopPropagation();
\r
299 evt.returnValue = false;
\r
302 var _preventDefault = function(evt) {
\r
303 if (evt.preventDefault) {
\r
304 evt.preventDefault();
\r
306 evt.returnValue = false;
\r
310 stopPropagation: _stopPropagation,
\r
311 preventDefault: _preventDefault
\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
320 $document.bind('click', callbackFunc);
\r
322 $document.unbind('click', callbackFunc);
\r
328 var _event = function (event, flag, callbackFunc, scope, timeoutFlag, timeoutValue) {
\r
330 if (!(timeoutValue)) {
\r
333 scope.$watch(flag, function (newVal, oldVal) {
\r
334 if (newVal !== oldVal) {
\r
335 $timeout(function () {
\r
337 $document.bind(event, callbackFunc);
\r
339 $document.unbind(event, callbackFunc);
\r
345 scope.$watch(flag, function (newVal, oldVal) {
\r
346 if (newVal !== oldVal) {
\r
348 $document.bind(event, callbackFunc);
\r
350 $document.unbind(event, callbackFunc);
\r
363 .factory('DOMHelper', function() {
\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
370 if (hasTabindex || tagName === 'A' || tagName === 'INPUT' || tagName === 'TEXTAREA') {
\r
371 return !(element[0].disabled || element[0].readOnly);
\r
376 function isValidChild(child) {
\r
377 return child.nodeType == 1 && child.nodeName != 'SCRIPT' && child.nodeName != 'STYLE';
\r
380 function traverse(obj) {
\r
381 var obj = obj || document.getElementsByTagName('body')[0];
\r
382 if (isValidChild(obj) && isTabable(obj)) {
\r
385 if (obj.hasChildNodes()) {
\r
386 var child = obj.firstChild;
\r
388 var res = traverse(child);
\r
393 child = child.nextSibling;
\r
402 var _firstTabableElement = function(el) {
\r
403 /* This will return the first tabable element from the parent el */
\r
405 if (el.hasOwnProperty('length')) {
\r
409 return traverse(elem);
\r
413 firstTabableElement: _firstTabableElement
\r
417 .factory('keymap', function(){
\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
441 isControl: function (e) {
\r
444 case this.KEY.COMMAND:
\r
445 case this.KEY.SHIFT:
\r
446 case this.KEY.CTRL:
\r
458 isFunctionKey: function (k) {
\r
459 k = k.keyCode ? k.keyCode : k;
\r
460 return k >= 112 && k <= 123;
\r
462 isVerticalMovement: function (k){
\r
463 return ~[this.KEY.UP, this.KEY.DOWN].indexOf(k);
\r
465 isHorizontalMovement: function (k){
\r
466 return ~[this.KEY.LEFT, this.KEY.RIGHT, this.KEY.BACKSPACE, this.KEY.DELETE].indexOf(k);
\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
474 .factory('keyMapAc', function(){
\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
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
487 .factory('$attElementDetach', function () {
\r
488 var _detach = function (element) {
\r
489 if (element && element.parentNode) {
\r
490 element.parentNode.removeChild(element);
\r
496 .factory('$ieVersion', function () {
\r
499 var loadIEVersion = function () {
\r
500 var isIE10 = (eval("/*@cc_on!@*/false") && document.documentMode === 10);
\r
505 div = document.createElement('div'),
\r
506 all = div.getElementsByTagName('i');
\r
508 div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->';
\r
510 return v > 4 ? v : undefined;
\r
513 return function () {
\r
515 ie = loadIEVersion();
\r
521 String.prototype.toSnakeCase = function () {
\r
522 return this.replace(/([A-Z])/g, function ($1) {
\r
523 return "-" + $1.toLowerCase();
\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
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
543 return concat(character, (width - actualString.length)) + actualString;
\r
545 return actualString + concat(character, (width - actualString.length));
\r
548 return actualString;
\r
551 String.prototype.lPad = function (width, character) {
\r
552 return pad(this, width, character, true);
\r
555 String.prototype.rPad = function (width, character) {
\r
556 return pad(this, width, character, false);
\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
571 angular.module('att.abs.position', [])
\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
580 // finally try and get inline style
\r
581 return el.style[cssprop];
\r
585 * Checks if a given element is statically positioned
\r
586 * @param element - raw DOM element
\r
588 function isStaticPositioned(element) {
\r
589 return (getStyle(element, "position") || 'static') === 'static';
\r
593 * returns the closest, non-statically positioned parentOffset of a given element
\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
602 return offsetParent || docDomEl;
\r
607 * Provides read-only equivalent of jQuery's position function:
\r
608 * http://api.jquery.com/position/
\r
610 position: function (element) {
\r
611 var elBCR = this.offset(element);
\r
612 var offsetParentBCR = {
\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
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
632 * Provides read-only equivalent of jQuery's offset function:
\r
633 * http://api.jquery.com/offset/
\r
635 offset: function (element) {
\r
636 var boundingClientRect = element[0].getBoundingClientRect();
\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
647 .factory('$isElement', [function () {
\r
648 var isElement = function (currentElem, targetElem, alternateElem) {
\r
649 if (currentElem[0] === targetElem[0]) {
\r
651 } else if (currentElem[0] === alternateElem[0]) {
\r
654 return isElement((currentElem.parent()[0] && currentElem.parent()) || targetElem, targetElem, alternateElem);
\r
661 .directive('attPosition', ['$position', function ($position) {
\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
675 angular.module('att.abs.transition', [])
\r
677 .factory('$transition', ['$q', '$timeout', '$rootScope', function($q, $timeout, $rootScope) {
\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
684 var transitionEndHandler = function() {
\r
685 $rootScope.$apply(function() {
\r
686 element.unbind(endEventName, transitionEndHandler);
\r
687 deferred.resolve(element);
\r
691 if (endEventName) {
\r
692 element.bind(endEventName, transitionEndHandler);
\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
701 } else if ( angular.isObject(trigger) ) {
\r
702 element.css(trigger);
\r
704 //If browser does not support transitions, instantly resolve
\r
705 if ( !endEventName ) {
\r
706 deferred.resolve(element);
\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
717 deferred.reject('Transition cancelled');
\r
720 return deferred.promise;
\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
731 var animationEndEventNames = {
\r
732 'WebkitTransition': 'webkitAnimationEnd',
\r
733 'MozTransition': 'animationend',
\r
734 'OTransition': 'oAnimationEnd',
\r
735 'transition': 'animationend'
\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
744 $transition.transitionEndEventName = findEndEventName(transitionEndEventNames);
\r
745 $transition.animationEndEventName = findEndEventName(animationEndEventNames);
\r
746 return $transition;
\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
755 .factory('animation', function(){
\r
758 .factory('$progressBar', function(){
\r
760 //Provides a function to pass in code for closure purposes
\r
761 var loadingAnimationCreator = function(onUpdateCallback){
\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
771 //Returns a function that takes a callback function and a duration for the animation
\r
772 return (function(){
\r
773 return loadingAnimation;
\r
777 return loadingAnimationCreator;
\r
779 .factory('$height', function(){
\r
780 var heightAnimation = function(element,duration,height,alpha){
\r
781 TweenMax.to(element,
\r
783 {height:height, autoAlpha:alpha},
\r
786 return heightAnimation;
\r
788 angular.module('att.abs.accordion', ['att.abs.utilities', 'att.abs.position', 'att.abs.transition'])
\r
789 .constant('accordionConfig', {
\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
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
809 if (this.groups.indexOf(openGroup) === (this.groups.length - 1) && $scope.forceExpand) {
\r
810 $scope.forceExpand = false;
\r
813 this.expandAll = function () {
\r
814 $scope.forceExpand = true;
\r
815 angular.forEach(this.groups, function (group) {
\r
816 group.isOpen = true;
\r
819 this.collapseAll = function () {
\r
820 angular.forEach(this.groups, function (group) {
\r
821 group.isOpen = false;
\r
824 /**function focus @param focusGroup */
\r
825 this.focus = function (focusGroup) {
\r
827 angular.forEach(this.groups, function (group, index) {
\r
828 if (group !== focusGroup) {
\r
829 group.focused = false;
\r
831 self.index = index;
\r
832 group.focused = true;
\r
836 /** @param blurGroup*/
\r
837 this.blur = function (blurGroup) {
\r
838 blurGroup.focused = false;
\r
840 $log.log("accordion.blur()", blurGroup);
\r
842 /** @param group - the group in current focus @param down - cycling down */
\r
843 this.cycle = function (group, down, noRecycle) {
\r
845 if (this.index <= 0 && !noRecycle) {
\r
846 this.index = this.groups.length - 1;
\r
851 if (this.index === (this.groups.length - 1))
\r
855 group.focused = false;
\r
868 group.focused = false;
\r
869 this.groups[this.index].setFocus = true;
\r
870 this.groups[this.index].focused = true;
\r
873 // This is called from the accordion-group directive to add itself to the accordion
\r
874 this.addGroup = function (groupScope) {
\r
876 groupScope.index = this.groups.length;
\r
877 groupScope.focused = false;
\r
878 this.groups.push(groupScope);
\r
880 if(this.groups.length > 0){
\r
884 groupScope.$on('$destroy', function () {
\r
885 that.removeGroup(groupScope);
\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
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
900 controller: 'AccordionController',
\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
913 scope.expandAll = false;
\r
916 scope.$watch("collapseAll", function (value) {
\r
918 ctrl.collapseAll();
\r
919 scope.collapseAll = false;
\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
928 // We need this directive to be inside an accordion
\r
929 require: ['^accordion', 'accordionGroup'],
\r
931 // It transcludes the contents of the directive into the template
\r
933 // The element containing the directive will be replaced with the template
\r
935 templateUrl: 'app/scripts/ng_js_att_tpls/accordion/accordion.html',
\r
937 // Create an isolated scope and interpolate the heading attribute onto this scope
\r
941 controller: ['$scope', function ($scope)
\r
943 $scope.showicon = true;
\r
944 this.setHeading = function (element)
\r
946 this.heading = element;
\r
947 $scope.showicon = false;
\r
949 this.isIsOpen = function ()
\r
951 return $scope.isOpen;
\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
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
965 var handleKeydown = function (ev) {
\r
966 var boolFlag = true;
\r
967 switch (ev.keyCode)
\r
970 ev.preventDefault();
\r
976 ev.preventDefault();
\r
977 accordionCtrl.cycle(scope, false);
\r
981 ev.preventDefault();
\r
982 accordionCtrl.cycle(scope, true);
\r
988 ev.stopPropagation();
\r
992 if (angular.isUndefined(scope.isOpen)) {
\r
993 scope.isOpen = false;
\r
996 tab.bind("keydown", handleKeydown);
\r
998 accordionCtrl.addGroup(scope);
\r
1000 if (scope.index === 0) {
\r
1001 scope.focused = true;
\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
1011 /* if the menu item does not have children, redirect to parent action URL*/
\r
1013 window.location.href = parentHyperLink;
\r
1018 scope.$watch('isOpen', function (value) {
\r
1020 accordionCtrl.closeOthers(scope);
\r
1024 scope.$watch("focused", function (value) {
\r
1026 tab.attr("tabindex", "0");
\r
1027 if(scope.setFocus){
\r
1032 scope.setFocus = false;
\r
1033 tab.attr("tabindex", "-1");
\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
1046 require: '^accordionGroup',
\r
1051 link: function (scope, element, attr, accordionCtrl)
\r
1053 var setIcon = function (isOpen) {
\r
1054 if (scope.expandIcon && scope.collapseIcon)
\r
1057 element.removeClass(scope.expandIcon);
\r
1058 element.addClass(scope.collapseIcon);
\r
1061 element.removeClass(scope.collapseIcon);
\r
1062 element.addClass(scope.expandIcon);
\r
1066 element.bind('click', function ()
\r
1068 accordionCtrl.toggle();
\r
1071 scope.$watch(function () {
\r
1072 return accordionCtrl.isIsOpen();
\r
1073 }, function (value) {
\r
1078 }).directive('accordionHeading', function () {
\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
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
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
1108 element.find("span").eq(0).prepend(heading);
\r
1114 .directive('attGoTop', ['$scrollTo', function ($scrollTo) {
\r
1117 transclude: false,
\r
1118 link: function (scope, elem, attrs)
\r
1120 elem.bind('click', function ()
\r
1122 $scrollTo(0, attrs["attGoTop"]);
\r
1127 .directive('attGoTo', ['$anchorScroll', '$location', function ($anchorScroll, $location) {
\r
1130 transclude: false,
\r
1131 link: function (scope, elem, attrs)
\r
1133 elem.bind('click', function ()
\r
1135 var newHash = attrs["attGoTo"];
\r
1136 if ($location.hash() !== newHash)
\r
1138 $location.hash(attrs["attGoTo"]);
\r
1148 .directive('freeStanding', function () {
\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
1160 compile: function (element, attr, transclude)
\r
1162 var link = function (scope, elem, attrs) {
\r
1163 scope.content = "";
\r
1164 transclude(scope, function (clone)
\r
1166 elem.find("span").append(clone);
\r
1168 scope.showAccordion = false;
\r
1169 scope.btnText = scope.showAccordion ? attrs.hideMsg : attrs.showMsg;
\r
1170 scope.fsToggle = function ()
\r
1172 scope.showAccordion = !scope.showAccordion;
\r
1173 scope.btnText = scope.showAccordion ? attrs.hideMsg : attrs.showMsg;
\r
1179 }).directive('expanders', function () {
\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
1190 this.toggle = function () {
\r
1191 $scope.isOpen = bodyScope.isOpen = !bodyScope.isOpen;
\r
1192 return bodyScope.isOpen;
\r
1195 link: function (scope)
\r
1197 scope.isOpen = false;
\r
1200 }).directive('expanderHeading', function () {
\r
1202 require: "^expanders",
\r
1207 template: "<div style='padding:10px !important' ng-transclude></div>"
\r
1209 }).directive('expanderBody', function () {
\r
1212 require: "^expanders",
\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
1222 }).directive('expanderToggle', function () {
\r
1225 require: "^expanders",
\r
1230 link: function (scope, element, attr, myCtrl)
\r
1232 var isOpen = false;
\r
1233 var setIcon = function () {
\r
1234 if (scope.expandIcon && scope.collapseIcon)
\r
1237 element.removeClass(scope.expandIcon);
\r
1238 element.addClass(scope.collapseIcon);
\r
1241 element.removeClass(scope.collapseIcon);
\r
1242 element.addClass(scope.expandIcon);
\r
1246 element.bind("keydown", function (e) {
\r
1247 if (e.keyCode === 13)
\r
1252 element.bind('click', function ()
\r
1256 scope.toggleit = function ()
\r
1258 isOpen = myCtrl.toggle();
\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
1274 marginBottom: null,
\r
1276 paddingBottom: null,
\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
1295 element.css(props.open);
\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
1302 link: function (scope, element, attrs) {
\r
1304 var initialAnimSkip = true;
\r
1305 scope.$watch(function () {
\r
1306 return element[0].scrollHeight;
\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
1317 fixUpHeight(scope, element, 'auto');
\r
1321 var currentTransition;
\r
1322 var doTransition = function (change) {
\r
1323 if (currentTransition) {
\r
1324 currentTransition.cancel();
\r
1326 currentTransition = $transition(element, change);
\r
1327 currentTransition.then(
\r
1329 currentTransition = undefined;
\r
1332 currentTransition = undefined;
\r
1335 return currentTransition;
\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
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
1351 fixUpHeight(scope, element, 'auto');
\r
1355 isCollapsed = false;
\r
1357 var collapse = function () {
\r
1358 isCollapsed = true;
\r
1359 if (initialAnimSkip) {
\r
1360 initialAnimSkip = false;
\r
1361 fixUpHeight(scope, element, 0);
\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
1369 scope.$watch(attrs.collapse, function (value) {
\r
1379 .directive('attAccord', function () {
\r
1385 controller: 'AttAccordCtrl',
\r
1386 templateUrl: 'app/scripts/ng_js_att_tpls/accordion/attAccordHeader.html'
\r
1389 .controller('AttAccordCtrl', [function () {
\r
1390 this.type = 'attAccord';
\r
1393 var isOpen = true;
\r
1394 this.toggleBody = function () {
\r
1396 this.expandBody();
\r
1399 this.collapseBody();
\r
1403 this.expandBody = function () {
\r
1404 this.bodyCtrl.expand();
\r
1406 this.collapseBody = function () {
\r
1407 this.bodyCtrl.collapse();
\r
1410 .controller('AttAccordHeaderCtrl', [function () {
\r
1411 this.type = 'header';
\r
1413 .directive('attAccordHeader', ['keymap', 'events', function (keymap, events) {
\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
1427 scope.clickFunc = function () {
\r
1428 attAccordCtrl.toggleBody();
\r
1431 var handleKeydown = function (ev) {
\r
1432 var boolFlag = true;
\r
1433 switch (ev.keyCode)
\r
1435 case keymap.KEY.ENTER:
\r
1436 ev.preventDefault();
\r
1437 scope.clickFunc();
\r
1444 ev.stopPropagation();
\r
1448 if (angular.isUndefined(scope.isOpen)) {
\r
1449 scope.isOpen = false;
\r
1452 tab.bind("keydown", handleKeydown);
\r
1456 .controller('AttAccordBodyCtrl', ['$scope', function ($scope) {
\r
1457 this.type = 'body';
\r
1458 this.expand = function () {
\r
1461 this.collapse = function () {
\r
1462 $scope.collapse();
\r
1465 .directive('attAccordBody', ['$timeout', '$height', function ($timeout, $height) {
\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
1482 scope.expand = function () {
\r
1483 $height(element, 0.05, originalHeight, 1);
\r
1485 scope.collapse = function () {
\r
1486 $height(element, 0.25, 0, 0);
\r
1491 angular.module('att.abs.alert', [])
\r
1492 .directive('attAlert', [function()
\r
1497 transclude : true,
\r
1499 alertType : "@type",
\r
1500 showTop : "@topPos",
\r
1503 templateUrl : 'app/scripts/ng_js_att_tpls/alert/alert.html',
\r
1504 link: function(scope)
\r
1506 if(scope.showTop === 'true'){
\r
1507 scope.cssStyle = {'top':'50px'};
\r
1510 scope.cssStyle = {'top':'0px'};
\r
1512 scope.close = function(){
\r
1513 scope.showAlert = false;
\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
1527 .directive('attBoard', [function() {
\r
1532 require: '^attBoardStrip',
\r
1537 templateUrl: 'app/scripts/ng_js_att_tpls/boardStrip/attBoard.html',
\r
1538 link: function(scope, element, attrs, ctrls) {
\r
1540 var parentCtrl = ctrls;
\r
1542 scope.getCurrentIndex = function() {
\r
1543 return parentCtrl.getCurrentIndex();
\r
1545 scope.selectBoard = function(boardIndex) {
\r
1546 if (!isNaN(boardIndex)) {
\r
1547 parentCtrl.setCurrentIndex(boardIndex);
\r
1550 scope.isInView = function(boardIndex) {
\r
1551 return parentCtrl.isInView(boardIndex);
\r
1556 .directive('attBoardStrip', ['BoardStripConfig', '$timeout', '$ieVersion', function(BoardStripConfig, $timeout, $ieVersion) {
\r
1562 currentIndex: '=selectedIndex',
\r
1563 boardsMasterArray : '=',
\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
1572 this.rectifyMaxVisibleBoards = function() {
\r
1573 if (this.maxVisibleIndex >= $scope.boardsMasterArray.length) {
\r
1574 this.maxVisibleIndex = $scope.boardsMasterArray.length - 1;
\r
1577 if (this.maxVisibleIndex < 0) {
\r
1578 this.maxVisibleIndex = 0;
\r
1582 this.resetBoardStrip = function(){
\r
1583 $scope.currentIndex = 0;
\r
1585 this.maxVisibleIndex = BoardStripConfig.maxVisibleBoards-1;
\r
1586 this.minVisibleIndex = 0;
\r
1588 this.rectifyMaxVisibleBoards();
\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
1598 $scope.currentIndex = index;
\r
1601 this.resetBoardStrip();
\r
1605 this.getCurrentIndex = function() {
\r
1606 return $scope.currentIndex;
\r
1608 this.setCurrentIndex = function(indx) {
\r
1609 $scope.currentIndex = indx;
\r
1612 this.isInView = function(index) {
\r
1613 return (index <= this.maxVisibleIndex && index >= this.minVisibleIndex);
\r
1616 this.getBoardsMasterArrayLength = function() {
\r
1617 return $scope.boardsMasterArray.length;
\r
1620 link: function(scope, element, attrs, ctrl) {
\r
1621 var ieVersion = $ieVersion();
\r
1624 var animationTimeout = 1000;
\r
1626 if(ieVersion && ieVersion < 10) {
\r
1627 animationTimeout = 0;
\r
1630 var getBoardViewportWidth = function (numberOfVisibleBoards) {
\r
1631 return numberOfVisibleBoards * (BoardStripConfig.boardLength + BoardStripConfig.boardMargin);
\r
1633 if(element[0].querySelector(".board-viewport")) {
\r
1634 angular.element(element[0].querySelector(".board-viewport")).css({"width": getBoardViewportWidth(BoardStripConfig.maxVisibleBoards) + "px"});
\r
1637 var getBoardstripContainerWidth = function (totalNumberOfBoards) {
\r
1638 return totalNumberOfBoards * (BoardStripConfig.boardLength + BoardStripConfig.boardMargin);
\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
1645 var calculateAndGetBoardstripContainerAdjustment = function () {
\r
1647 var calculatedAdjustmentValue;
\r
1649 if(ctrl.getBoardsMasterArrayLength() <= BoardStripConfig.maxVisibleBoards) {
\r
1650 calculatedAdjustmentValue = 0;
\r
1653 calculatedAdjustmentValue = (ctrl.minVisibleIndex * (BoardStripConfig.boardLength + BoardStripConfig.boardMargin))* -1;
\r
1656 return calculatedAdjustmentValue;
\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
1663 for (var i = minViewIndex; i <= maxViewIndex; i++) {
\r
1664 angular.element(boardArray[i]).attr('tabindex', '0');
\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
1675 var currentBoardArray = element[0].querySelectorAll('[att-board]');
\r
1676 if(currentBoardArray.length !== 0) {
\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
1683 $timeout.cancel(oldTimeout);
\r
1684 oldTimeout = $timeout(function(){
\r
1685 currentBoardArray[0].focus();
\r
1686 }, animationTimeout);
\r
1689 currentBoardArray[0].focus();
\r
1693 element[0].querySelector('div.boardstrip-item--add').focus();
\r
1696 angular.element(element[0].querySelector(".boardstrip-container")).css({"width": getBoardstripContainerWidth(ctrl.getBoardsMasterArrayLength()) + "px"});
\r
1699 /* When a board is added */
\r
1701 ctrl.maxVisibleIndex = ctrl.getBoardsMasterArrayLength()-1;
\r
1702 ctrl.minVisibleIndex = Math.max(ctrl.maxVisibleIndex - BoardStripConfig.maxVisibleBoards + 1, 0);
\r
1704 ctrl.setCurrentIndex(ctrl.maxVisibleIndex);
\r
1706 $timeout(function(){
\r
1707 angular.element(element[0].querySelector(".boardstrip-container")).css({"width": getBoardstripContainerWidth(ctrl.getBoardsMasterArrayLength()) + "px"});
\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
1715 $timeout.cancel(oldTimeout);
\r
1716 oldTimeout = $timeout(function(){
\r
1717 currentBoardArray[currentBoardArray.length-1].focus();
\r
1718 }, animationTimeout);
\r
1721 currentBoardArray[currentBoardArray.length-1].focus();
\r
1723 /* Update tabindecies to ensure keyboard navigation behaves correctly */
\r
1724 updateBoardsTabIndex(currentBoardArray, ctrl.minVisibleIndex, ctrl.maxVisibleIndex);
\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
1735 $timeout.cancel(oldTimeout);
\r
1736 angular.element(element[0].querySelector(".boardstrip-container")).css({"left": calculateAndGetBoardstripContainerAdjustment() + "px"});
\r
1738 $timeout(function(){
\r
1739 var currentBoardArray = element[0].querySelectorAll('[att-board]');
\r
1741 /* Remove tabindex from non-visible boards */
\r
1742 updateBoardsTabIndex(currentBoardArray, ctrl.minVisibleIndex, ctrl.maxVisibleIndex);
\r
1744 if (!(scope.isNextBoard())) {
\r
1746 currentBoardArray[currentBoardArray.length-1].focus();
\r
1749 }, animationTimeout);
\r
1751 scope.prevBoard = function() {
\r
1753 ctrl.minVisibleIndex -= BoardStripConfig.boardsToScroll;
\r
1754 if (ctrl.minVisibleIndex < 0) {
\r
1755 ctrl.minVisibleIndex = 0;
\r
1758 ctrl.maxVisibleIndex = ctrl.minVisibleIndex + BoardStripConfig.maxVisibleBoards-1;
\r
1759 ctrl.rectifyMaxVisibleBoards();
\r
1761 $timeout.cancel(oldTimeout);
\r
1762 angular.element(element[0].querySelector(".boardstrip-container")).css({"left": calculateAndGetBoardstripContainerAdjustment() + "px"});
\r
1764 $timeout(function(){
\r
1765 var currentBoardArray = element[0].querySelectorAll('[att-board]');
\r
1767 /* Remove tabindex from non-visible boards */
\r
1768 updateBoardsTabIndex(currentBoardArray, ctrl.minVisibleIndex, ctrl.maxVisibleIndex);
\r
1770 if (ctrl.minVisibleIndex === 0) {
\r
1772 element[0].querySelector('div.boardstrip-item--add').focus();
\r
1773 } catch (e) {} /* IE8 may throw exception */
\r
1778 scope.isPrevBoard = function() {
\r
1779 return (ctrl.minVisibleIndex > 0);
\r
1781 scope.isNextBoard = function() {
\r
1782 return (ctrl.getBoardsMasterArrayLength()-1 > ctrl.maxVisibleIndex);
\r
1787 .directive('attAddBoard', ['BoardStripConfig', '$parse', '$timeout', function(BoardStripConfig, $parse, $timeout) {
\r
1791 require: '^attBoardStrip',
\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
1807 .directive('attBoardNavigation', ['keymap', 'events', function(keymap, events) {
\r
1810 link: function(scope, elem) {
\r
1812 var prevElem = keymap.KEY.LEFT;
\r
1813 var nextElem = keymap.KEY.RIGHT;
\r
1815 elem.bind('keydown', function (ev) {
\r
1817 if (!(ev.keyCode)) {
\r
1818 ev.keyCode = ev.which;
\r
1821 switch (ev.keyCode) {
\r
1823 events.preventDefault(ev);
\r
1824 events.stopPropagation(ev);
\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
1830 var el = angular.element(elem[0])[0];
\r
1832 if (el.nextSibling){
\r
1833 el = el.nextSibling;
\r
1838 } while (el && el.tagName !== 'LI');
\r
1840 if (el.tagName && el.tagName === 'LI' && parseInt(angular.element(el).attr('tabindex')) >= 0){
\r
1847 events.preventDefault(ev);
\r
1848 events.stopPropagation(ev);
\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
1854 var el1 = angular.element(elem[0])[0];
\r
1856 if (el1.previousSibling){
\r
1857 el1 = el1.previousSibling;
\r
1862 } while (el1 && el1.tagName !== 'LI');
\r
1864 if (el1.tagName && el1.tagName === 'LI' && parseInt(angular.element(el).attr('tabindex')) >= 0){
\r
1877 angular.module('att.abs.breadCrumbs', [])
\r
1878 .constant("classConstant",{
\r
1879 "defaultClass" : "breadcrumbs__link",
\r
1880 "activeClass": "breadcrumbs__link--active"
\r
1882 .directive('attCrumb', ['classConstant', function(classConstant) {
\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
1890 if(!elem.hasClass('last')){
\r
1891 elem.after('<i class="breadcrumbs__item"></i>');
\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
1905 .directive('attButton', ['btnConfig', function (btnConfig) {
\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
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
1934 .directive('attButtonLoader', [function () {
\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
1947 .directive('attButtonHero', [function () {
\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
1962 .directive('attBtnDropdown', ['$document', '$timeout', '$isElement', '$documentBind', 'keymap', 'events', function ($document, $timeout, $isElement, $documentBind, keymap, events) {
\r
1966 type: "@dropdowntype"
\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
1980 var toggle = scope.toggle = function (show) {
\r
1981 if (angular.isUndefined(show) || show === '') {
\r
1982 scope.isOpen = !scope.isOpen;
\r
1985 scope.isOpen = show;
\r
1988 var selectNext = function() {
\r
1989 if (currentIndex+1 < list.length) {
\r
1991 list[currentIndex].focus();
\r
1994 var selectPrev = function() {
\r
1995 if (currentIndex-1 >= 0) {
\r
1997 list[currentIndex].focus();
\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
2010 case keymap.KEY.ESC:
\r
2012 currentIndex = -1;
\r
2016 case keymap.KEY.DOWN:
\r
2019 events.preventDefault($event);
\r
2020 events.stopPropagation($event);
\r
2022 case keymap.KEY.UP:
\r
2025 events.preventDefault($event);
\r
2026 events.stopPropagation($event);
\r
2031 } else if (keyCode === keymap.KEY.TAB) {
\r
2033 currentIndex = -1;
\r
2037 var outsideClick = function (e) {
\r
2038 var isElement = $isElement(angular.element(e.target), element, $document);
\r
2041 currentIndex = -1;
\r
2042 for (var i = 0; i < list.length; i++) {
\r
2043 angular.element(list[i]).removeClass('selected');
\r
2049 $documentBind.click('isOpen', outsideClick, scope);
\r
2053 angular.module('att.abs.checkbox', [])
\r
2054 .constant("attCheckboxConfig", {
\r
2055 activeClass : "att-checkbox--on",
\r
2056 disabledClass : "att-checkbox--disabled"
\r
2058 .directive('checkboxLimit', function () {
\r
2061 checkboxLimit:'=',
\r
2066 require:'checkboxLimit',
\r
2067 controller: ['$scope',function($scope)
\r
2069 $scope.limit=true;
\r
2070 this.getMaxLimits=function(){
\r
2071 return $scope.limit;
\r
2073 this.setMaxLimits=function(value){
\r
2074 $scope.limit=value;
\r
2076 this.maxCheckboxSelected=function(){
\r
2077 $scope.maxSelected();
\r
2080 link: function (scope, element, attribute, ctrl) {
\r
2081 scope.$watch('checkboxLimit', function()
\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
2089 if(countTrue>=parseInt(scope.selectLimit)){
\r
2090 ctrl.setMaxLimits(false);
\r
2093 ctrl.setMaxLimits(true);
\r
2099 .directive('attCheckbox', ['$compile', "attCheckboxConfig", function ($compile, attCheckboxConfig) {
\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
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
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
2132 checkboxLimitCtrl.maxCheckboxSelected();
\r
2133 ngCtrl.$setViewValue(element.parent().hasClass(attCheckboxConfig.activeClass) ? true : false);
\r
2140 evt.preventDefault();
\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
2151 .directive('checkboxGroup', ['$compile',function($compile) {
\r
2154 checkboxGroup: "=",
\r
2155 checkboxGroupValue: "=?"
\r
2158 link: function(scope, element, attribute){
\r
2159 scope.checkboxState = 'none';
\r
2160 if (scope.checkboxGroupValue === undefined) {
\r
2161 scope.checkboxGroupValue = "indeterminate";
\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
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
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
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
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
2202 evt.preventDefault();
\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
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
2222 scope.$watch('checkboxGroup', function(){
\r
2223 var countTrue = 0;
\r
2224 var countFalse = 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
2232 else if (!scope.checkboxGroup[keys]) {
\r
2233 countFalse = countFalse + 1;
\r
2237 if (count === countTrue) {
\r
2238 scope.checkboxState = "all";
\r
2239 scope.checkboxGroupValue=true;
\r
2241 else if (count === countFalse) {
\r
2242 scope.checkboxState = "none";
\r
2243 scope.checkboxGroupValue=false;
\r
2246 scope.checkboxState = "indeterminate";
\r
2247 scope.checkboxGroupValue="indeterminate";
\r
2254 angular.module('att.abs.colorselector', [])
\r
2255 .directive('colorSelectorWrapper', [function() {
\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
2273 .directive('colorSelector', ['$compile', function($compile) {
\r
2277 colorSelector: '@',
\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
2289 angular.module('att.abs.datepicker', ['att.abs.position', 'att.abs.utilities'])
\r
2291 .constant('datepickerConfig', {
\r
2292 dateFormat: 'MM/dd/yyyy',
\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
2305 defaultText: 'Select from list'
\r
2307 datepickerEvalAttributes: ['dateFormat', 'dayFormat', 'monthFormat', 'yearFormat', 'dayHeaderFormat', 'dayTitleFormat', 'disableWeekend', 'disableSunday', 'startingDay', 'mode'],
\r
2308 datepickerWatchAttributes: ['min', 'max']
\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
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
2330 var watchFunction = function (key, val) {
\r
2331 scope.$parent.$watch(val, function (value) {
\r
2332 scope[key] = value;
\r
2334 scope.$watch(key, function (value) {
\r
2335 scope.$parent[val] = value;
\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
2352 var validateDateString = function (dateString, dateFormat) {
\r
2353 if (dateString && dateFormat) {
\r
2355 if (dateFormat.indexOf('/') !== -1) {
\r
2357 } else if (dateFormat.indexOf('-') !== -1) {
\r
2359 } else if (dateFormat.indexOf('.') !== -1) {
\r
2363 var dateStringArray = dateString.split(delimiter);
\r
2364 var dateFormatArray = dateFormat.split(delimiter);
\r
2365 if (dateStringArray.length !== dateFormatArray.length) {
\r
2369 for (var i = 0; i < dateStringArray.length; i++) {
\r
2370 dateStringArray[i] = dateStringArray[i].lPad(dateFormatArray[i].length, '0');
\r
2372 var intermediateDateString = dateStringArray.join(delimiter);
\r
2374 var actualDateString = dateFilter(new Date(intermediateDateString), dateFormat);
\r
2375 return intermediateDateString === actualDateString;
\r
2380 setAttributes: setAttributes,
\r
2381 bindScope: bindScope,
\r
2382 validateDateString: validateDateString
\r
2386 .controller('DatepickerController', ['$scope', '$attrs', 'dateFilter', 'datepickerConfig', function($scope, $attrs, dateFilter, dtConfig) {
\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
2397 startingDay = getValue($attrs.startingDay, dtConfig.startingDay);
\r
2398 $scope.mode = getValue($attrs.mode, dtConfig.mode);
\r
2400 $scope.minDate = dtConfig.minDate ? $scope.resetTime(dtConfig.minDate) : null;
\r
2401 $scope.maxDate = dtConfig.maxDate ? $scope.resetTime(dtConfig.maxDate) : null;
\r
2403 function getValue(value, defaultValue) {
\r
2404 return angular.isDefined(value) ? $scope.$parent.$eval(value) : defaultValue;
\r
2407 function getDaysInMonth(year, month) {
\r
2408 return new Date(year, month, 0).getDate();
\r
2411 function getDates(startDate, n) {
\r
2413 var current = startDate, i = 0;
\r
2415 dates[i++] = new Date(current);
\r
2416 current.setDate(current.getDate() + 1);
\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
2425 function isSelected(dt) {
\r
2426 if (dt && angular.isDate($scope.currentDate) && compare(dt, $scope.currentDate) === 0) {
\r
2432 function isFromDate(dt) {
\r
2433 if (dt && angular.isDate($scope.fromDate) && compare(dt, $scope.fromDate) === 0) {
\r
2439 function isToDate(dt) {
\r
2440 if (dt && angular.isDate($scope.fromDate) && angular.isDate($scope.currentDate) && compare(dt, $scope.currentDate) === 0) {
\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
2453 function isWeekend(date) {
\r
2454 if (dateFilter(date, format.dayHeader) === "Saturday" || dateFilter(date, format.dayHeader) === "Sunday") {
\r
2460 function isToday(date) {
\r
2461 if (compare(date, $scope.resetTime(new Date())) === 0) {
\r
2466 function isFocused(date) {
\r
2467 if (date && angular.isDate($scope.focusedDate) && compare(date, $scope.focusedDate) === 0) {
\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
2477 if (format.disableSunday === true && (dateFilter(date, format.dayHeader) === "Sunday")) {
\r
2480 return (($scope.minDate && compare(date, $scope.minDate) < 0) || ($scope.maxDate && compare(date, $scope.maxDate) > 0));
\r
2484 function isMinDateAvailable(startDate, endDate) {
\r
2485 return ($scope.minDate && $scope.minDate.getTime() >= startDate.getTime()) && ($scope.minDate.getTime() <= endDate.getTime());
\r
2488 function isMaxDateAvailable(startDate, endDate) {
\r
2489 return ($scope.maxDate && $scope.maxDate.getTime() >= startDate.getTime()) && ($scope.maxDate.getTime() <= endDate.getTime());
\r
2492 function getLabel(label) {
\r
2496 pre: label.substr(0, 3),
\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
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
2516 if (numDisplayedFromPreviousMonth > 0) {
\r
2517 firstDate.setDate(-numDisplayedFromPreviousMonth + 1);
\r
2518 numDates += numDisplayedFromPreviousMonth; // Previous
\r
2520 numDates += getDaysInMonth(year, month + 1); // Current
\r
2521 numDates += (7 - numDates % 7) % 7; // Next
\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
2540 for (var j = 0; j < 7; j++) {
\r
2541 labels[j] = getLabel(dateFilter(days[j].date, format.dayHeader));
\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
2550 $scope.disablePrevTop = $scope.disablePrevBottom = isMinDateAvailable(firstDayOfMonth, lastDayOfMonth);
\r
2551 $scope.disableNextTop = $scope.disableNextBottom = isMaxDateAvailable(firstDayOfMonth, lastDayOfMonth);
\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
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
2576 isDisabled:isDisabled(dt),
\r
2577 isToday:isToday(dt),
\r
2578 isWeakend:false});
\r
2580 return {objects: months, title: dateFilter(date, format.year), labels: labels};
\r
2589 .directive('datepicker', ['$timeout', function ($timeout) {
\r
2594 templateUrl: 'app/scripts/ng_js_att_tpls/datepicker/datepicker.html',
\r
2596 currentDate: "=?current",
\r
2597 fromDate: "=?from"
\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
2606 scope.resetTime = function(date) {
\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
2613 dt = new Date(dt.getFullYear(), dt.getMonth(), dt.getDate());
\r
2622 scope.$parent.$watch(attrs.min, function(value) {
\r
2623 scope.minDate = value ? scope.resetTime(value) : null;
\r
2628 scope.$parent.$watch(attrs.max, function(value) {
\r
2629 scope.maxDate = value ? scope.resetTime(value) : null;
\r
2634 // Split array into smaller arrays
\r
2635 function split(arr, size) {
\r
2637 while (arr.length > 0) {
\r
2638 arrays.push(arr.splice(0, size));
\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
2648 return selectedDate;
\r
2651 function refill(date) {
\r
2652 if (angular.isDate(date) && !isNaN(date)) {
\r
2653 selected = new Date(date);
\r
2656 selected = new Date();
\r
2661 var selectedCalendar;
\r
2662 if(scope.mode === 1){
\r
2663 selected = new Date();
\r
2664 selectedCalendar = moveMonth(angular.copy(selected), -1);
\r
2666 selectedCalendar = angular.copy(selected);
\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
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
2681 var selectCurrentDate = function(date) {
\r
2682 var dt = new Date(date.getFullYear(), date.getMonth(), date.getDate());
\r
2683 scope.currentDate = dt;
\r
2686 var selectFromDate = function(date) {
\r
2687 var dt = new Date(date.getFullYear(), date.getMonth(), date.getDate());
\r
2688 scope.fromDate = dt;
\r
2691 scope.select = function(date) {
\r
2692 calendarSelected = true;
\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
2702 selectCurrentDate(date);
\r
2704 scope.focusedDate = date;
\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
2716 scope.move = function(direction) {
\r
2717 selected = moveMonth(angular.copy(selected), direction);
\r
2721 scope.$watch('currentDate', function (value) {
\r
2722 if(angular.isDate(value) && !isNaN(value) && datepickerCtrl.isDisabled(value)) {
\r
2723 scope.currentDate = null;
\r
2727 if (attrs.from && !isNaN(value) && !isNaN(scope.fromDate) && datepickerCtrl.compare(value, scope.fromDate) < 0) {
\r
2728 swapDate(scope.fromDate, value);
\r
2732 if (calendarSelected) {
\r
2734 calendarSelected = false;
\r
2736 if (angular.isDefined(value) && value !== null) {
\r
2742 scope.focusedDate = undefined;
\r
2745 scope.$watch('fromDate', function (value) {
\r
2746 if(angular.isDate(value) && !isNaN(value) && datepickerCtrl.isDisabled(value)) {
\r
2747 scope.fromDate = null;
\r
2751 if (!isNaN(scope.currentDate) && !isNaN(value) && datepickerCtrl.compare(scope.currentDate, value) < 0) {
\r
2752 swapDate(value, scope.currentDate);
\r
2755 if (calendarSelected) {
\r
2757 calendarSelected = false;
\r
2759 if (angular.isDefined(value) && value !== null) {
\r
2766 scope.focusedDate = undefined;
\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
2775 scope.isOpen = false;
\r
2777 var toggle = scope.toggle = function (show) {
\r
2778 if(show === true || show === false) {
\r
2779 scope.isOpen = show;
\r
2781 scope.isOpen = !scope.isOpen;
\r
2785 scope.$watch('current', function () {
\r
2789 var outsideClick = function (e) {
\r
2790 var isElement = $isElement(angular.element(e.target), elem, $document);
\r
2797 $documentBind.click('isOpen', outsideClick, scope);
\r
2804 templateUrl: 'app/scripts/ng_js_att_tpls/datepicker/datepickerPopup.html',
\r
2806 current: "=current"
\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
2818 .directive('attDatepicker', ['$log', function($log) {
\r
2821 require: 'ngModel',
\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
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
2839 datepickerService.setAttributes($attrs, wrapperElement);
\r
2840 datepickerService.bindScope($attrs, $scope);
\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
2847 var elm = wrapperElement.prop('outerHTML');
\r
2848 elm = $compile(elm)($scope);
\r
2849 $element.replaceWith(elm);
\r
2851 link: function(scope, elem, attr, ctrl) {
\r
2853 // do nothing if no ng-model
\r
2854 $log.error("ng-model is required.");
\r
2858 scope.$watch('current', function(value) {
\r
2859 ctrl.$setViewValue(value);
\r
2861 ctrl.$render = function() {
\r
2862 scope.current = ctrl.$viewValue;
\r
2868 .directive('formatDate', ['dateFilter', 'datepickerService', function(dateFilter, datepickerService) {
\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
2877 var dateToString = function(value) {
\r
2879 ctrl.$setValidity('invalidDate', true);
\r
2880 return dateFilter(value, formatDate);
\r
2882 ctrl.$setValidity('invalidDate', false);
\r
2883 return elem.val();
\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
2891 ctrl.$setValidity('invalidDate', false);
\r
2895 ctrl.$formatters.unshift(dateToString);
\r
2896 ctrl.$parsers.unshift(stringToDate);
\r
2901 .directive('attDateFilter', ['$document', 'dateFilter', 'datepickerConfig', 'datepickerService', '$isElement', '$documentBind', function($document, dateFilter, datepickerConfig, datepickerService, $isElement, $documentBind) {
\r
2903 var link = function (scope, elem, attr, ctrl) {
\r
2904 datepickerService.bindScope(attr, scope);
\r
2906 scope.selectedOption = datepickerConfig.dateFilter.defaultText;
\r
2907 scope.showDropdownList = false;
\r
2908 scope.showCalendar = false;
\r
2909 scope.applyButtonType = "disabled";
\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
2915 var setDropdownText = function(value) {
\r
2920 var fromDateText = dateFormatString.toUpperCase();
\r
2921 var currentDateText = dateFormatString.toUpperCase();
\r
2923 if(!isNaN(new Date(scope.fromDate))) {
\r
2924 fromDateText = dateFilter(scope.fromDate, dateFormatString);
\r
2926 if(!isNaN(new Date(scope.currentDate))) {
\r
2927 currentDateText = dateFilter(scope.currentDate, dateFormatString);
\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
2942 var clear = scope.clear = function(partial) {
\r
2943 scope.fromDate = undefined;
\r
2944 scope.currentDate = undefined;
\r
2945 scope.applyButtonType = "disabled";
\r
2947 ctrl.$setValidity('invalidDate', true);
\r
2948 ctrl.$setValidity('invalidDateRange', true);
\r
2949 setDropdownText(scope.currentSelection);
\r
2953 var showCalendar = function() {
\r
2954 scope.showCalendar = true;
\r
2957 var hideCalendar = function() {
\r
2958 scope.showCalendar = false;
\r
2959 if(scope.currentSelection !== 'Custom Single Date' && scope.currentSelection !== 'Custom Range') {
\r
2964 var showDropdown = scope.showDropdown = function (show) {
\r
2965 if(show === true || show === false) {
\r
2966 scope.showDropdownList = show;
\r
2968 scope.showDropdownList = !scope.showDropdownList;
\r
2971 if (!scope.showDropdownList) {
\r
2972 scope.focusInputButton = true;
\r
2975 if (scope.currentSelection === 'Custom Single Date' || scope.currentSelection === 'Custom Range') {
\r
2981 scope.resetTime = function(date) {
\r
2983 if (!isNaN(new Date(date))) {
\r
2984 dt = new Date(date);
\r
2988 return new Date(dt.getFullYear(), dt.getMonth(), dt.getDate());
\r
2991 scope.getDropdownText = function () {
\r
2992 inputChange = true;
\r
2993 var dropdownText = scope.selectedOption;
\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
3001 ctrl.$setValidity('invalidDate', false);
\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
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
3027 ctrl.$setValidity('invalidDateRange', false);
\r
3031 ctrl.$setValidity('invalidDate', false);
\r
3035 ctrl.$setValidity('invalidDateRange', false);
\r
3041 scope.untrackInputChange = function() {
\r
3042 inputChange = false;
\r
3045 scope.selectAdvancedOption = function (value, notClearFlag) {
\r
3046 scope.currentSelection = value;
\r
3047 if(!notClearFlag){
\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
3060 scope.$watch('fromDate', function(val) {
\r
3061 if(!isNaN(new Date(val))) {
\r
3062 setDropdownText(value);
\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
3072 scope.resetFocus = function () {
\r
3073 scope.focusSingleDateCalendar = false;
\r
3074 scope.focusRangeCalendar = false;
\r
3075 scope.focusApplyButton = false;
\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
3084 scope.from = undefined;
\r
3085 scope.dateRange.from = undefined;
\r
3087 if(!isNaN(new Date(scope.currentDate))) {
\r
3088 scope.current = scope.currentDate;
\r
3089 scope.dateRange.current = scope.currentDate;
\r
3091 scope.current = undefined;
\r
3092 scope.dateRange.current = undefined;
\r
3098 scope.$watchCollection(function() {
\r
3099 return scope.dateRange;
\r
3100 }, function(value) {
\r
3102 var finalDateRange = angular.copy(value);
\r
3103 ctrl.$setViewValue(finalDateRange);
\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
3125 scope.cancel = function() {
\r
3126 scope.currentSelection = "";
\r
3127 scope.selectedOption = datepickerConfig.dateFilter.defaultText;
\r
3131 var outsideClick = function (e) {
\r
3132 var isElement = $isElement(angular.element(e.target), elem, $document);
\r
3138 $documentBind.click('showDropdownList', outsideClick, scope);
\r
3145 current: "=?current"
\r
3148 require: '?ngModel',
\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
3155 current: undefined
\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
3165 $scope.checkCurrentSelection=this.checkCurrentSelection = function(value) {
\r
3166 if(value === $scope.currentSelection) {
\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
3185 .directive('attDateFilterList',function(){
\r
3189 fromDate:'=fromDate',
\r
3191 caption:'=caption',
\r
3192 disabled:'=disabled'
\r
3194 require:'^attDateFilter',
\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
3202 scope.checkCurrentSelection=ctrl.checkCurrentSelection;
\r
3206 angular.module('att.abs.devNotes', [])
\r
3208 .directive('attDevNotes', function() {
\r
3213 controller: function($scope){
\r
3214 var panes = $scope.panes = [];
\r
3215 $scope.select = function(pane)
\r
3217 angular.forEach(panes, function(pane)
\r
3219 pane.selected = false;
\r
3221 pane.selected = true;
\r
3223 this.addPane = function(pane) {
\r
3224 if (panes.length === 0) {
\r
3225 $scope.select(pane);
\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
3236 '<div ng-transclude></div>'+
\r
3242 .directive('pane', function() {
\r
3244 require: '^attDevNotes',
\r
3250 link: function(scope, element, attrs, tabsCtrl) {
\r
3251 tabsCtrl.addPane(scope);
\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
3263 angular.module('att.abs.dividerLines', [])
\r
3264 .directive('attDividerLines', [function()
\r
3268 attDividerLines: '@'
\r
3272 templateUrl: 'app/scripts/ng_js_att_tpls/dividerLines/dividerLines.html',
\r
3273 link: function(scope, element, attribute)
\r
3275 scope.lightContainer = attribute.attDividerLines;
\r
3280 angular.module('att.abs.dragdrop', [])
\r
3281 .directive('attFileDrop', ['$parse', function($parse) {
\r
3289 controller: ['$scope', '$attrs', function($scope, $attrs){
\r
3290 if($attrs.attFileDrop!==""){
\r
3291 $scope.onDrop=$scope.attFileDrop;
\r
3293 this.onDrop = $scope.onDrop;
\r
3295 link: function(scope, element) {
\r
3296 element.addClass('dragdrop');
\r
3300 if(e.originalEvent){
\r
3301 e.dataTransfer = e.originalEvent.dataTransfer;
\r
3303 e.dataTransfer.dropEffect = 'move';
\r
3304 // allows us to drop
\r
3305 if (e.preventDefault) {
\r
3306 e.preventDefault();
\r
3308 element.addClass('dragdrop-over');
\r
3315 // allows us to drop
\r
3316 if (e.preventDefault) {
\r
3317 e.preventDefault();
\r
3319 element.addClass('dragdrop-over');
\r
3326 element.removeClass('dragdrop-over');
\r
3333 // Stops some browsers from redirecting.
\r
3334 if(e.preventDefault) {
\r
3335 e.preventDefault();
\r
3337 if (e.stopPropagation) {
\r
3338 e.stopPropagation();
\r
3340 if(e.originalEvent){
\r
3341 e.dataTransfer = e.originalEvent.dataTransfer;
\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
3347 if(typeof scope.onDrop === "function"){
\r
3348 scope.onDrop = $parse(scope.onDrop);
\r
3358 .directive('attFileLink', [ function() {
\r
3361 require: '^?attFileDrop',
\r
3364 templateUrl: 'app/scripts/ng_js_att_tpls/dragdrop/fileUpload.html',
\r
3367 onFileSelect : '&',
\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
3377 $scope.fileModel = fileModel;
\r
3381 this.callbackFunction= function(){
\r
3382 if(typeof $scope.onFileSelect === "function"){
\r
3383 $scope.onFileSelect = $parse($scope.onFileSelect);
\r
3384 $scope.onFileSelect();
\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
3394 if(attr.attFileLink!==""){
\r
3395 scope.onFileSelect=scope.attFileLink;
\r
3397 else if(!(attr.onFileSelect) && attFileDropCtrl){
\r
3398 scope.onFileSelect = attFileDropCtrl.onDrop;
\r
3403 .directive('attFileChange', ['$log','$rootScope',function($log,$rootScope) {
\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
3415 var strFileName = e.target.value;
\r
3417 var objFSO = new ActiveXObject("Scripting.FileSystemObject");
\r
3418 attFileLinkCtrl.setFileModel(objFSO.getFile(strFileName));
\r
3419 attFileLinkCtrl.callbackFunction();
\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
3431 angular.module("att.abs.drawer", ['att.abs.utilities'])
\r
3432 .directive('attDrawer', ['$document', '$timeout', 'DOMHelper', function ($document, $timeout, DOMHelper) {
\r
3439 drawerAutoClose: "&?"
\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
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
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
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
3482 $timeout(function() {
\r
3483 firstElement = DOMHelper.firstTabableElement(element[0]);
\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
3492 else if(param.side==='top' || param.side==='bottom'){
\r
3493 slider.style.height = '0px';
\r
3496 $scope.drawerOpen = false;
\r
3498 if (angular.isDefined(drawerLaunchingElement) && drawerLaunchingElement != null) {
\r
3499 drawerLaunchingElement.focus();
\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
3510 else if(param.side==='top' || param.side==='bottom'){
\r
3511 slider.style.height = param.size;
\r
3513 $timeout(function() {
\r
3514 content.style.display = 'block';
\r
3516 if (angular.isDefined(firstElement) && firstElement != null) {
\r
3517 firstElement.focus();
\r
3519 },(param.speed * 1000));
\r
3522 function isFunction(functionToCheck) {
\r
3524 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
\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
3539 $scope.$watch("drawerOpen", function (value){
\r
3542 drawerOpen(slider,param);
\r
3545 drawerClose(slider,param);
\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
3556 $scope.$on("$stateChangeStart", function(){
\r
3557 drawerClose(slider, param);
\r
3558 if(isFunction($scope.drawerAutoClose)) {
\r
3559 $scope.drawerAutoClose();
\r
3567 angular.module('att.abs.message', [])
\r
3569 .directive('attMessages', [function() {
\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
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
3586 $scope.error = null;
\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
3594 $scope.messageScope[i].hide();
\r
3597 if($scope.error === null) {
\r
3598 $scope.setMessageType(null);
\r
3601 $scope.setMessageType = this.setMessageType = function(messageType) {
\r
3602 if($attrs.messageType) {
\r
3603 $scope.messageType = messageType;
\r
3610 .directive('attMessage', [function() {
\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
3623 scope.hide = function() {
\r
3624 elem.css({display: 'none'});
\r
3631 angular.module('att.abs.formField', ['att.abs.message', 'att.abs.utilities'])
\r
3632 .directive('attFormField', [function() {
\r
3636 controller:function() {
\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
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
3647 elem.parent().parent().find('label').addClass('form-field__label--hide').removeClass('form-field__label--show');
\r
3651 elem.bind('blur', function() {
\r
3652 if (this.value === '') {
\r
3653 elem.parent().parent().find('label').removeClass('form-field__label--hide');
\r
3659 .directive('attFormFieldValidation', ['$compile', '$log', function($compile, $log) {
\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
3670 $log.error("att-form-field-validation :: ng-model directive is required.");
\r
3673 if (!attFormFieldCtrl) {
\r
3674 $log.error("att-form-field-validation :: att-form-field directive is required.");
\r
3678 elem.parent().append($compile(angular.element('<i class="icon-info-alert error" ng-show="valid===false"> </i>'))(scope));
\r
3679 elem.parent().append($compile(angular.element('<i class="icon-info-success success" ng-show="valid===true"> </i>'))(scope));
\r
3681 scope.$watch('valid', function(value) {
\r
3683 elem.parent().parent().addClass('success');
\r
3684 } else if (value === false) {
\r
3685 elem.parent().parent().addClass('error');
\r
3687 elem.parent().parent().removeClass('success').removeClass('error');
\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
3704 .directive('attFormFieldValidationAlert', ['$timeout', function($timeout) {
\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
3727 scope.errorMessage = false;
\r
3728 scope.warningMessage = false;
\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
3738 elem.find('label').css({top: '-20px'});
\r
3741 scope.showLabel = false;
\r
3742 scope.hideLabel = true;
\r
3744 elem.find('label').css({top: '0px'});
\r
3747 checkMessageType();
\r
3751 elem.find('input').bind('blur', function() {
\r
3752 if (this.value === '') {
\r
3753 scope.showLabel = false;
\r
3754 scope.hideLabel = false;
\r
3758 $timeout(function() {
\r
3759 checkMessageType();
\r
3764 .constant("CoreFormsUiConfig", {
\r
3765 phoneMask: '(___) ___-____'
\r
3767 .directive('attPhoneMask', ['$parse', 'CoreFormsUiConfig', function($parse, CoreFormsUiConfig) {
\r
3769 require: 'ngModel',
\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
3777 var validPhoneNumber = false;
\r
3782 A = CoreFormsUiConfig.phoneMask;
\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
3794 var handleKeyup = function() {
\r
3795 var E,D = ctrl.$modelValue;
\r
3799 var L, K, G, J, I;
\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
3814 ctrl.$setViewValue(D);
\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
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
3833 e.preventDefault ? e.preventDefault() : e.returnValue = false;
\r
3834 iElement.attr("aria-label","Only numbers are allowed");
\r
3835 validPhoneNumber = false;
\r
3838 iElement.removeAttr("aria-label");
\r
3839 validPhoneNumber = true;
\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
3854 if (fromViewValue && fromViewValue.length > 0) {
\r
3855 clean = fromViewValue.replace(/[^0-9]/g, '');
\r
3857 checkValidity(clean);
\r
3861 //to handle reading the model and formatting it
\r
3862 var formatter = function(fromModelView) {
\r
3864 checkValidity(fromModelView);
\r
3865 if (fromModelView){
\r
3866 input = handleKeyup();}
\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
3880 .constant('validationTypeInt', {
\r
3881 validationNum: {'number':'1','text':'2','email':'3'}
\r
3883 .directive('attFormFieldPrv', [ 'keyMapAc', 'validationTypeInt', function( keyMapAc, validationTypeInt ) {
\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
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
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
3918 var expAlphanumericSpecialChar = '^[a-zA-Z0-9' + outputSpecialChars + ']*$';
\r
3919 var regularExp = new RegExp( expAlphanumericSpecialChar, 'i' );
\r
3920 return regularExp.test( validationInput );
\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
3928 var expNumberSpecial = '^[0-9\.' + outputSpecialChars + ']*$';
\r
3929 var regularExp = new RegExp( expNumberSpecial, 'i' );
\r
3930 return regularExp.test( validationInput );
\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
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
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
3953 switch ( validationTypeInt.validationNum[ validationType ] ) {
\r
3954 case validationTypeInt.validationNum["text"]:
\r
3955 result = this.validateText( validationType, allowedChars, validationInput, outputSpecialChars );
\r
3957 case validationTypeInt.validationNum["number"]:
\r
3958 result = this.validateNumber( validationType, allowedChars, validationInput, outputSpecialChars );
\r
3960 case validationTypeInt.validationNum["email"]:
\r
3961 result = this.validateEmail( validationType, allowedChars, validationInput, outputSpecialChars );
\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
3976 .directive('attFormFieldValidationPrv', [ 'keyMapAc','validationTypeInt' , function( keyMapAc, validationTypeInt ) {
\r
3980 validationType: '=',
\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
3993 attFormFieldCtrl.showHideErrorMessage(true);
\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
4005 var validateNumberCode = function( charFound,event ){
\r
4006 return ( ( event.which < keyMapSc['startNum'] || event.which > keyMapSc['endNum'] ) && ( !charFound ) );
\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
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
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
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
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
4046 else if(event.charCode){
\r
4047 event.which = event.charCode;
\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
4062 .directive('attFormFieldValidationAlertPrv', [ function() {
\r
4065 scope : { errorMessage : '=' },
\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
4074 scope.hideErrorMsg = true;
\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
4086 pattern: /^(6011|65|64[4-9]|622)/,
\r
4087 format: defaultFormat,
\r
4088 inputFormat: defaultInputFormat,
\r
4091 cvcSecurityImg: 'visaI',
\r
4097 pattern: /^5[1-5]/,
\r
4098 format: defaultFormat,
\r
4099 inputFormat: defaultInputFormat,
\r
4102 cvcSecurityImg: 'visaI',
\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
4113 cvcSecurityImg: 'amexI',
\r
4120 format: defaultFormat,
\r
4121 inputFormat: defaultInputFormat,
\r
4124 cvcSecurityImg: 'visaI',
\r
4130 var _fromNumber = function(num) {
\r
4133 num = (num + '').replace(/\D/g, '');
\r
4135 for (i = 0, len = cards.length; i < len; i++) {
\r
4139 if (card.pattern.test(num)) {
\r
4146 var _fromType = function(type) {
\r
4149 for (i = 0, len = cards.length; i < len; i++) {
\r
4153 if (card.type === type) {
\r
4161 fromNumber: function(val) {
\r
4162 return _fromNumber(val);
\r
4164 fromType: function(val) {
\r
4165 return _fromType(val);
\r
4167 defaultFormat: function() {
\r
4168 return defaultFormat;
\r
4170 defaultInputFormat: function() {
\r
4171 return defaultInputFormat;
\r
4176 .factory('_Validate', ['Cards', '$parse', function(Cards, $parse) {
\r
4177 var __indexOf = [].indexOf || function(item)
\r
4179 for (var i = 0, l = this.length; i < l; i++)
\r
4181 if (i in this && this[i] === item)
\r
4189 var _luhnCheck = function(num) {
\r
4190 var digit, digits, odd, sum, i, len;
\r
4194 digits = (num + '').split('').reverse();
\r
4196 for (i = 0, len = digits.length; i < len; i++) {
\r
4198 digit = digits[i];
\r
4199 digit = parseInt(digit, 10);
\r
4201 if ((odd = !odd)) {
\r
4213 return sum % 10 === 0;
\r
4216 var _validators = {};
\r
4218 _validators['cvc'] = function(cvc, ctrl, scope, attr) {
\r
4221 // valid if empty - let ng-required handle empty
\r
4222 if ((angular.isUndefined(cvc)) || (cvc === null) || (cvc.length === 0))
\r
4227 if (!/^\d+$/.test(cvc)) {
\r
4232 if (attr.paymentsTypeModel) {
\r
4233 var typeModel = $parse(attr.paymentsTypeModel);
\r
4234 type = typeModel(scope);
\r
4239 ref1 = Cards.fromType(type);
\r
4240 return (ref = cvc.length, __indexOf.call((ref1 !== null) ? ref1.cvcLength : void 0, ref)) >= 0;
\r
4244 return cvc.length >= 3 && cvc.length <= 4;
\r
4247 _validators['zip'] = function(zip, ctrl, scope, attr) {
\r
4250 // valid if empty - let ng-required handle empty
\r
4251 if ((angular.isUndefined(zip)) || (zip === null) || (zip.length === 0))
\r
4256 if (!/^\d+$/.test(zip)) {
\r
4261 if (attr.paymentsTypeModel) {
\r
4262 var typeModel = $parse(attr.paymentsTypeModel);
\r
4263 type = typeModel(scope);
\r
4267 ref1 = Cards.fromType(type);
\r
4268 return (ref = zip.length, __indexOf.call(ref1 !== null ? ref1.zipLength : void 0, ref)) >= 0;
\r
4272 return zip.length < 6;
\r
4275 _validators['card'] = function(num, ctrl, scope, attr) {
\r
4276 var card, ref, typeModel;
\r
4278 if (attr.paymentsTypeModel) {
\r
4279 typeModel = $parse(attr.paymentsTypeModel);
\r
4282 var clearCard = function() {
\r
4284 typeModel.assign(scope, null);
\r
4286 ctrl.$card = null;
\r
4289 // valid if empty - let ng-required handle empty
\r
4290 if ((angular.isUndefined(num)) || (num === null) || (num.length === 0)) {
\r
4295 num = (num + '').replace(/\s+|-/g, '');
\r
4297 if (!/^\d+$/.test(num)) {
\r
4302 card = Cards.fromNumber(num);
\r
4307 ctrl.$card = angular.copy(card);
\r
4310 typeModel.assign(scope, card.type);
\r
4313 ret = (ref = num.length, __indexOf.call(card.length, ref) >= 0) && (card.luhn === false || _luhnCheck(num));
\r
4316 return function(type, val, ctrl, scope, attr) {
\r
4317 if (!_validators[type]) {
\r
4319 types = Object.keys(_validators);
\r
4321 errstr = 'Unknown type for validation: "' + type + '". ';
\r
4322 errstr += 'Should be one of: "' + types.join('", "') + '"';
\r
4326 return _validators[type](val, ctrl, scope, attr);
\r
4329 .factory('_ValidateWatch', ['_Validate', function(_Validate) {
\r
4331 var _validatorWatches = {};
\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
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
4353 return function(type, ctrl, scope, attr) {
\r
4354 if (_validatorWatches[type]) {
\r
4355 return _validatorWatches[type](type, ctrl, scope, attr);
\r
4359 .directive('validateCard', ['$window', '_Validate', '_ValidateWatch', function($window, _Validate, _ValidateWatch) {
\r
4362 require: 'ngModel',
\r
4363 link: function(scope, elem, attr, ctrl) {
\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
4372 if (ctrl.$card === null)
\r
4374 if ((val == null) || (val === "") || (val === ''))
\r
4376 scope.invalidCardError = '';
\r
4377 scope.invalidCard = "";
\r
4379 else if (val.length >= 1)
\r
4381 scope.invalidCardError = 'error';
\r
4382 scope.invalidCard = "The number entered is not a recognized credit card number.";
\r
4389 if (ctrl.$card.length.indexOf(val.length) >= 0)
\r
4391 scope.invalidCardError = 'error';
\r
4392 scope.invalidCard = "The number entered is not a recognized credit card number.";
\r
4396 scope.invalidCardError = '';
\r
4397 scope.invalidCard = "";
\r
4402 scope.invalidCardError = '';
\r
4403 scope.invalidCard = "";
\r
4406 elem.bind("blur", function()
\r
4408 if ((!valid) || (ctrl.$card === null))
\r
4410 scope.invalidCardError = 'error';
\r
4411 scope.invalidCard = "The number entered is not a recognized credit card number.";
\r
4415 scope.invalidCardError = '';
\r
4416 scope.invalidCard = "";
\r
4420 return valid ? val : undefined;
\r
4422 ctrl.$formatters.push(validateFn);
\r
4423 ctrl.$parsers.push(validateFn);
\r
4427 .directive('creditCardImage', function() {
\r
4429 templateUrl: 'app/scripts/ng_js_att_tpls/formField/creditCardImage.html',
\r
4431 transclude: false,
\r
4432 link: function(scope, element, attr)
\r
4434 scope.$watch(attr.creditCardImage, function(newVal, oldVal)
\r
4436 if (newVal !== oldVal)
\r
4439 if (!angular.isUndefined(newVal) && newVal !== null)
\r
4441 scope.newValCCI = 'show-' + newVal;
\r
4443 if (newVal === null)
\r
4445 scope.newValCCI = '';
\r
4452 .directive('securityCodeImage', ['$document', function($document) {
\r
4454 templateUrl: 'app/scripts/ng_js_att_tpls/formField/cvcSecurityImg.html',
\r
4456 transclude: false,
\r
4457 link: function(scope, element, attr)
\r
4459 scope.$watch(attr.securityCodeImage, function(newVal, oldVal)
\r
4461 if (newVal !== oldVal)
\r
4463 if (!angular.isUndefined(newVal) && newVal !== null)
\r
4465 if (newVal === 'amexI')
\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
4472 else if (newVal === 'visaI')
\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
4480 if (newVal === null)
\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
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
4496 element.find("button").addClass("active");
\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
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
4520 .controller('hourPickerController', ['$scope', function ($scope) {
\r
4522 $scope.options = [];
\r
4523 this.setOptions = function (value, fromtime, totime, preselect, uncheckedFromTime, uncheckedToTime) {
\r
4524 $scope.options.push(value);
\r
4526 if (preselect !== undefined) {
\r
4527 $scope.preselect = preselect;
\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
4541 $scope.FrtimeList[$scope.days[daycount]].value = fromtime[0].value;
\r
4542 $scope.selectedFromOption[$scope.days[daycount]] = fromtime[0].value;
\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
4556 $scope.TotimeList[$scope.days[daycount]].value = totime[0].value;
\r
4557 $scope.selectedToOption[$scope.days[daycount]] = totime[0].value;
\r
4559 $scope.showToTimeErrorDay[$scope.days[daycount]] = false;
\r
4564 if (uncheckedFromTime !== undefined) {
\r
4565 $scope.uncheckedFromTime = uncheckedFromTime;
\r
4567 if (uncheckedToTime !== undefined) {
\r
4568 $scope.uncheckedToTime = uncheckedToTime;
\r
4572 this.getSelectedOption = function () {
\r
4573 return $scope.selectedOption;
\r
4576 this.setToTimeErrorDay = function (day, flag) {
\r
4577 $scope.showToTimeErrorDay[day] = flag;
\r
4581 .directive('attHourpickerOption', [function () {
\r
4584 require: '^attHourpicker',
\r
4586 option: "=option",
\r
4587 fromtime: "=fromtime",
\r
4588 totime: "=totime",
\r
4589 preselect: "=preselect",
\r
4590 uncheckedFromTime: "=",
\r
4591 uncheckedToTime: "="
\r
4593 link: function (scope, element, attr, ctrl) {
\r
4594 ctrl.setOptions(scope.option,
\r
4598 scope.uncheckedFromTime,
\r
4599 scope.uncheckedToTime);
\r
4604 .directive('attHourpicker', ["hourpickerConfig", "$document", "$log", "$documentBind", "$timeout", function (hourpickerConfig, $document, $log, $documentBind, $timeout) {
\r
4606 require: 'ngModel',
\r
4608 controller: 'hourPickerController',
\r
4611 model: "=ngModel",
\r
4614 templateUrl: 'app/scripts/ng_js_att_tpls/hourpicker/hourpicker.html',
\r
4615 link: function (scope, element, attr, ctrl) {
\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
4633 scope.resetFlag = false;
\r
4634 scope.showToTimeErrorDay = {};
\r
4635 scope.validatedCustomPreselect = [];
\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
4647 scope.preselectUpdateFxn(scope.preselect);
\r
4649 scope.resetFlag = false;
\r
4653 scope.$watch('selCategory', function (value) {
\r
4655 ctrl.$setViewValue(value);
\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
4667 if (typeof value[arry].preEnabled === 'boolean' && value[arry].preEnabled) {
\r
4668 scope.daysList[day] = true;
\r
4670 scope.daysList[day] = false;
\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
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
4686 scope.addSelectedValue(day, value[arry].FromTime, value[arry].ToTime);
\r
4689 if (parseInt(arry) + 1 === value.length) {
\r
4695 scope.selectOption(value.day);
\r
4699 scope.$watch('preselect', function (value) {
\r
4700 scope.preselectUpdateFxn(value);
\r
4703 scope.preselectUpdateFxn = function (value) {
\r
4704 if (value !== undefined) {
\r
4705 if (scope.options) {
\r
4706 value = scope.validatePreselectData(value);
\r
4708 if (value === "") {
\r
4711 scope.updateData(value);
\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
4729 if (!isDayFound) {
\r
4730 value.splice(arry, 1);
\r
4733 for (var fromcount in scope.fromtime) {
\r
4734 if (scope.fromtime[fromcount].value === value[arry].FromTime) {
\r
4735 isFrmFound = true;
\r
4739 if (!isFrmFound) {
\r
4740 value[arry].FromTime = scope.fromtime[0].value;
\r
4742 for (var tocount in scope.totime) {
\r
4743 if (scope.totime[tocount].value === value[arry].ToTime) {
\r
4749 value[arry].ToTime = scope.totime[0].value;
\r
4752 if (typeof value[arry].preEnabled === 'boolean' && value[arry].preEnabled) {
\r
4753 value[arry].preEnabled = true;
\r
4755 value[arry].preEnabled = false;
\r
4758 scope.validatedCustomPreselect[day] = {};
\r
4759 scope.validatedCustomPreselect[day].FromTime = value[arry].FromTime;
\r
4760 scope.validatedCustomPreselect[day].ToTime = value[arry].ToTime;
\r
4763 if (parseInt(arry) + 1 === value.length) {
\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
4776 if (!isOptionFound) {
\r
4783 scope.selectPrevNextValue = function ($event, arrayValues, currValue) {
\r
4787 if ($event.keyCode === 38) {
\r
4789 } else if ($event.keyCode === 40) {
\r
4795 if (arrayValues.indexOf(currValue) !== -1) {
\r
4796 index = arrayValues.indexOf(currValue) + value;
\r
4798 for (var count in arrayValues) {
\r
4799 if (arrayValues[count].value === currValue) {
\r
4800 index = parseInt(count) + value;
\r
4806 if (index === arrayValues.length) {
\r
4807 index = index - 1;
\r
4808 } else if (index === -1) {
\r
4809 index = index + 1;
\r
4812 $event.preventDefault();
\r
4813 if (arrayValues[index].value) {
\r
4814 return arrayValues[index].value;
\r
4816 return arrayValues[index];
\r
4820 scope.showDropdown = function () {
\r
4821 scope.showlist = !scope.showlist;
\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
4832 for (count in scope.TotimeListDay) {
\r
4833 if (scope.TotimeListDay[count]) {
\r
4834 scope.TotimeListDay[count] = false;
\r
4837 scope.FrtimeListDay[value] = !scope.FrtimeListDay[value];
\r
4839 scope.showlist = false;
\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
4846 scope.isFromDropDownOpen = false;
\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
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
4866 for (count in scope.FrtimeListDay) {
\r
4867 if (scope.FrtimeListDay[count]) {
\r
4868 scope.FrtimeListDay[count] = false;
\r
4871 scope.TotimeListDay[value] = !scope.TotimeListDay[value];
\r
4873 scope.showlist = false;
\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
4881 scope.isToDropDownOpen = false;
\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
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
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
4908 scope.addSelectedValue = function (value, fromtime, totime) {
\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
4916 scope.selectedFromOption[scope.customTime[count].day] = scope.FrtimeList[scope.customTime[count].day].value;
\r
4919 if (scope.uncheckedToTime) {
\r
4920 scope.selectedToOption[scope.customTime[count].day] = scope.uncheckedToTime;
\r
4922 scope.selectedToOption[scope.customTime[count].day] = scope.TotimeList[scope.customTime[count].day].value;
\r
4925 scope.customTime.splice(count, 1);
\r
4930 if (scope.selectedFromOption[value] === scope.uncheckedFromTime) {
\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
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
4944 if (scope.selectedToOption[value] === scope.uncheckedToTime) {
\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
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
4957 custTime["day"] = value;
\r
4958 custTime["FromTime"] = scope.FrtimeList[value].value;
\r
4959 custTime["ToTime"] = scope.TotimeList[value].value;
\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
4968 if (count === len) {
\r
4969 var x = angular.copy(custTime);
\r
4970 scope.customTime.push(x);
\r
4973 scope.selCategory = scope.customTime;
\r
4977 var outsideClick = function () {
\r
4978 if (scope.showlist) {
\r
4979 scope.$apply(function () {
\r
4980 scope.showlist = false;
\r
4985 $documentBind.click('showlist', outsideClick, scope);
\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
4996 $documentBind.click('isFromDropDownOpen', outsideClickFromDropdown, scope);
\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
5007 $documentBind.click('isToDropDownOpen', outsideClickToDropdown, scope);
\r
5009 scope.selectOption = function (sItem) {
\r
5011 if (sItem === hourpickerConfig.customOption) {
\r
5012 scope.showDaysSelector = true;
\r
5013 scope.selCategory = scope.customTime;
\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
5020 FromTime: fromTime === null ? 'NA' : fromTime[0],
\r
5021 ToTime: toTime === null ? 'NA' : toTime[0]
\r
5025 scope.showlist = false;
\r
5027 scope.selectedOption = sItem;
\r
5033 .directive('attHourpickerValidator', ['hourpickerConfig', function (hourpickerConfig) {
\r
5036 require: ['attHourpicker', 'ngModel'],
\r
5037 link: function (scope, element, attr, ctrl) {
\r
5039 var attHourpickerCtrl = ctrl[0];
\r
5040 var ngModelCtrl = ctrl[1];
\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
5050 if (AMPM === 'AM' && hours === 12) {
\r
5051 hours = hours - 12;
\r
5053 var sHours = hours.toString();
\r
5054 var sMinutes = minutes.toString();
\r
5056 sHours = '0' + sHours;
\r
5058 if (minutes < 10) {
\r
5059 sMinutes = '0' + sMinutes;
\r
5061 return parseInt(sHours + sMinutes, 10);
\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
5070 var validateCustomData = function (finalDataModal) {
\r
5072 if (attHourpickerCtrl.getSelectedOption() === hourpickerConfig.customOption) {
\r
5074 var errorDaysCount = 0;
\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
5082 attHourpickerCtrl.setToTimeErrorDay(finalDataModal[item].day, false);
\r
5087 if (errorDaysCount > 0) {
\r
5088 //validation error
\r
5089 ngModelCtrl.$setValidity('validationStatus', false);
\r
5092 //validation successful
\r
5093 ngModelCtrl.$setValidity('validationStatus', true);
\r
5094 return finalDataModal;
\r
5097 //default case no validation
\r
5098 ngModelCtrl.$setValidity('validationStatus', true);
\r
5099 return finalDataModal;
\r
5104 ngModelCtrl.$parsers.unshift(validateCustomData);
\r
5108 angular.module('att.abs.iconButtons', [])
\r
5109 .constant('buttonConfig', {
\r
5110 activeClass: 'active--button',
\r
5111 toggleEvent: 'click'
\r
5113 .directive('attIconBtnRadio', ['buttonConfig', function(buttonConfig) {
\r
5114 var activeClass = buttonConfig.activeClass || 'active--button';
\r
5115 var toggleEvent = buttonConfig.toggleEvent || 'click';
\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
5122 ngModelCtrl.$render = function() {
\r
5123 element.parent().toggleClass(activeClass, angular.equals(ngModelCtrl.$modelValue, attrs.attIconBtnRadio));
\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
5137 .directive('attIconBtnCheckbox', ['buttonConfig', function(buttonConfig) {
\r
5138 var activeClass = buttonConfig.activeClass || 'active--button';
\r
5139 var toggleEvent = buttonConfig.toggleEvent || 'click';
\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
5149 function getFalseValue() {
\r
5150 var falseValue = scope.$eval(attrs.btnCheckboxFalse);
\r
5151 return angular.isDefined(falseValue) ? falseValue : false;
\r
5154 ngModelCtrl.$render = function() {
\r
5155 element.parent().toggleClass(activeClass, angular.equals(ngModelCtrl.$modelValue, getTrueValue()));
\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
5168 angular.module('att.abs.links', ['ngSanitize'])
\r
5169 .directive('attLink', [function() {
\r
5172 link: function(scope, elem) {
\r
5173 elem.addClass('link');
\r
5174 if(!(elem.attr('href'))){
\r
5175 elem.attr("tabindex", "0");
\r
5180 .directive('attLinkVisited', [function() {
\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
5191 .directive('attReadmore', ['$timeout',function($timeout) {
\r
5195 lines:"@noOfLines",
\r
5197 //attribute to use readmore inside accordion
\r
5200 templateUrl: 'app/scripts/ng_js_att_tpls/links/readMore.html',
\r
5201 link: function(scope, elem) {
\r
5203 scope.$watch('textModel', function(val){
\r
5205 scope.textToDisplay = '';
\r
5206 scope.readMoreLink = false;
\r
5207 scope.readLessLink = false;
\r
5208 scope.readFlag = false;
\r
5211 if (typeof String.prototype.trim !== 'function') {
\r
5212 String.prototype.trim = function() {
\r
5213 return this.replace(/^\s+|\s+$/g, '');
\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
5221 if(window.getComputedStyle){
\r
5222 height = parseInt(scope.lines) * parseFloat(window.getComputedStyle(readElem,null).getPropertyValue("height"));
\r
5225 height = parseInt(scope.lines) * parseFloat(readElem.currentStyle.height);
\r
5227 scope.elemHeight = height;
\r
5228 scope.readLinkStyle = {'height': scope.elemHeight + 'px'};
\r
5231 scope.readMoreLink = true;
\r
5232 scope.readLessLink = false;
\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
5240 scope.readMoreLink = true;
\r
5241 scope.readLessLink = false;
\r
5242 scope.readLinkStyle = {'height': scope.elemHeight + 'px'};
\r
5243 scope.readFlag = true;
\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
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
5266 readLessLink.focus();
\r
5272 .directive('attLinksList', [function() {
\r
5275 controller: function() {
\r
5277 link: function(scope, elem) {
\r
5278 elem.addClass('links-list');
\r
5282 .directive('attLinksListItem', [function() {
\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
5294 angular.module('att.abs.loading', [])
\r
5295 .directive('attLoading', ['$window',function($window) {
\r
5300 icon: '@attLoading',
\r
5301 progressStatus: '=?',
\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
5311 'background-position-x' : shiftX,
\r
5312 'background-position-y' : -shiftY
\r
5318 angular.module('att.abs.modal', ['att.abs.utilities'])
\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
5323 .factory('$$stackedMap', function () {
\r
5325 createNew: function () {
\r
5329 add: function (key, value) {
\r
5335 get: function (key) {
\r
5336 for (var i = 0; i < stack.length; i++) {
\r
5337 if (key === stack[i].key) {
\r
5342 keys: function() {
\r
5344 for (var i = 0; i < stack.length; i++) {
\r
5345 keys.push(stack[i].key);
\r
5349 top: function () {
\r
5350 return stack[stack.length - 1];
\r
5352 remove: function (key) {
\r
5354 for (var i = 0; i < stack.length; i++) {
\r
5355 if (key === stack[i].key) {
\r
5360 return stack.splice(idx, 1)[0];
\r
5362 removeTop: function () {
\r
5363 return stack.splice(stack.length - 1, 1)[0];
\r
5365 length: function () {
\r
5366 return stack.length;
\r
5374 * A helper directive for the $modal service. It creates a backdrop element.
\r
5376 .directive('modalBackdrop', ['$timeout', function ($timeout) {
\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
5391 .directive('modalWindow', ['$modalStack','$timeout','$document', function ($modalStack,$timeout,$document) {
\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
5407 $timeout(function () {
\r
5408 // trigger CSS transitions
\r
5409 scope.focusModalFlag = true;
\r
5410 scope.animate = true;
\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
5417 if (element[0] !== e.target && !element[0].contains( e.target )) {
\r
5418 element[0].focus();
\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
5430 evt.returnValue = false;
\r
5432 $modalStack.dismiss(modal.key, 'backdrop click');
\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
5455 return topBackdropIndex;
\r
5458 $rootScope.$watch(backdropIndex, function(newBackdropIndex){
\r
5459 backdropScope.index = newBackdropIndex;
\r
5462 function removeModalWindow(modalInstance) {
\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
5474 //remove backdrop if no longer needed
\r
5475 if (backdropDomEl && backdropIndex() == -1) {
\r
5476 backdropDomEl.remove();
\r
5477 backdropDomEl = undefined;
\r
5480 modalWindow.modalScope.$destroy();
\r
5483 if (angular.isDefined(modalLaunchingElement) && modalLaunchingElement != null) {
\r
5484 modalLaunchingElement.focus();
\r
5487 $document.bind('keydown', function (evt) {
\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
5496 } else if (evt.keyCode === keymap.KEY.BACKSPACE) {
\r
5497 var doPrevent = false;
\r
5498 var d = evt.srcElement || evt.target;
\r
5500 if (d.type === undefined) {
\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
5513 || d.tagName.toUpperCase() === 'TEXTAREA') {
\r
5514 doPrevent = d.readOnly || d.disabled;
\r
5519 events.preventDefault(evt);
\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
5532 //Before opening modal, find the focused element
\r
5533 modalLaunchingElement = document.activeElement;
\r
5535 var body = $document.find('body').eq(0);
\r
5536 var html = $document.find('html').eq(0);
\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
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
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
5556 $modalStack.close = function (modalInstance, result) {
\r
5557 var modal = openedWindows.get(modalInstance);
\r
5559 modal.value.deferred.resolve(result);
\r
5560 removeModalWindow(modalInstance);
\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
5572 $modalStack.getTop = function () {
\r
5573 return openedWindows.top();
\r
5576 return $modalStack;
\r
5579 .provider('$modal', function () {
\r
5581 var $modalProvider = {
\r
5583 //can be also false or 'static'
\r
5587 $get: ['$injector', '$rootScope', '$q', '$http', '$templateCache', '$controller', '$modalStack',
\r
5588 function ($injector, $rootScope, $q, $http, $templateCache, $controller, $modalStack) {
\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
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
5604 return promisesArr;
\r
5606 $modal.open = function (modalOptions) {
\r
5607 var modalResultDeferred = $q.defer();
\r
5608 var modalOpenedDeferred = $q.defer();
\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
5617 dismiss: function (reason) {
\r
5618 $modalStack.dismiss(modalInstance, reason);
\r
5621 //merge and clean up options
\r
5622 modalOptions = angular.extend({}, $modalProvider.options, modalOptions);
\r
5623 modalOptions.resolve = modalOptions.resolve || {};
\r
5626 if (!modalOptions.template && !modalOptions.templateUrl) {
\r
5627 throw new Error('One of template or templateUrl options is required.');
\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
5637 var ctrlInstance, ctrlLocals = {};
\r
5638 var resolveIter = 1;
\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
5648 ctrlInstance = $controller(modalOptions.controller, ctrlLocals);
\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
5661 }, function(reason) {
\r
5662 modalResultDeferred.reject(reason);
\r
5665 templateAndResolvePromise.then(function () {
\r
5666 modalOpenedDeferred.resolve(true);
\r
5668 modalOpenedDeferred.reject(false);
\r
5671 return modalInstance;
\r
5678 return $modalProvider;
\r
5681 .directive("simpleModal", ["$modal", function($modal) {
\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
5701 scope.backdrop === "false" ? scope.backdropclick = 'static' : scope.backdropclick = true;
\r
5702 scope.keyboard === "false" ? scope.keyboardev = false : scope.keyboardev = true;
\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
5717 .directive('tabbedItem', ['$modal', '$log',function ($modal, $log){
\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
5736 $scope.items[i].isTabOpen = false;
\r
5737 $scope.items[i].showData = false;
\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
5746 items: function () {
\r
5747 return $scope.items;
\r
5751 modalInstance.result.then(function (selectedItem) {
\r
5752 $scope.selected = selectedItem;
\r
5754 $log.info('Modal dismissed at: ' + new Date());
\r
5757 $scope.isActiveTab = function (index) {
\r
5758 return $scope.items && $scope.items[index] && $scope.items[index].isTabOpen;
\r
5764 .directive('tabbedOverlay', [function () {
\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
5781 $scope.items[i].isTabOpen = false;
\r
5782 $scope.items[i].showData = false;
\r
5786 $scope.isActiveTab = function (index) {
\r
5787 return $scope.items && $scope.items[index] && $scope.items[index].isTabOpen;
\r
5792 angular.module('att.abs.pagination', ['att.abs.utilities'])
\r
5793 .directive('attPagination', [ function() {
\r
5800 clickHandler: '=?'
\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
5810 scope.totalPages = 1;
\r
5814 for (var i = 1; i <= value; i++) {
\r
5815 scope.pages.push(i);
\r
5817 } else if (value > 7) {
\r
5818 var midVal = Math.ceil(value / 2);
\r
5819 scope.pages = [midVal - 1, midVal, midVal + 1];
\r
5821 currentPageChanged(1);
\r
5824 scope.$watch('currentPage', function(value) {
\r
5825 currentPageChanged(value);
\r
5827 var callbackHandler = function(num) {
\r
5828 if (angular.isFunction(scope.clickHandler)){
\r
5829 scope.clickHandler(num);
\r
5832 function currentPageChanged(value) {
\r
5833 if (angular.isDefined(value) && value !== null) {
\r
5834 if (!value || value < 1) {
\r
5837 if (value > scope.totalPages) {
\r
5838 value = scope.totalPages;
\r
5840 if(scope.currentPage !== value) {
\r
5841 scope.currentPage = value;
\r
5842 callbackHandler(scope.currentPage);
\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
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
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
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
5877 scope.checkSelectedPage = function(value) {
\r
5878 if(scope.currentPage === value) {
\r
5883 scope.isFocused = function(page) {
\r
5884 return scope.focusedPage === page;
\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
5897 .factory('animation', function(){
\r
5899 }).directive('attPaneAccessibility',['keymap','$window',function(keymap,$window) {
\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
5909 div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i>< ![endif]-->',
\r
5912 return v > 4 ? v : undef;
\r
5914 if(scope.ie === 8){
\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
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
5934 if (el && el.nextSibling){
\r
5935 el = el.nextSibling;
\r
5940 } while (el && el.tagName !== 'DIV');
\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
5952 if (el && el.previousSibling){
\r
5953 el = el.previousSibling;
\r
5958 } while (el && el.tagName !== 'DIV');
\r
5962 case keymap.KEY.RIGHT:
\r
5963 if(angular.isDefined(sidepaneCtrl)){
\r
5964 el = sidepaneCtrl.getElement()[0];
\r
5966 if(angular.isDefined(innerPaneCtrl)){
\r
5967 el = innerPaneCtrl.getElement()[0];
\r
5970 if (el && el.nextElementSibling){
\r
5971 el = el.nextElementSibling;
\r
5976 }while(window.getComputedStyle(el, null).getPropertyValue("display") === 'none');
\r
5980 if (el && el.nextSibling){
\r
5981 el = el.nextSibling;
\r
5986 }while ((el && el.tagName == 'DIV') && el.currentStyle['display'] == 'none');
\r
5989 el.querySelector("[att-pane-accessibility]").focus();
\r
5992 case keymap.KEY.LEFT:
\r
5993 if(angular.isDefined(sidepaneCtrl)){
\r
5994 el = sidepaneCtrl.getElement()[0];
\r
5996 if(angular.isDefined(innerPaneCtrl)){
\r
5997 el = innerPaneCtrl.getElement()[0];
\r
6000 if (el && el.previousElementSibling){
\r
6001 el = el.previousElementSibling;
\r
6006 }while (window.getComputedStyle(el, null).getPropertyValue("display") == 'none');
\r
6011 if (el && el.previousSibling){
\r
6012 el = el.previousSibling;
\r
6017 }while((el && el.tagName == 'DIV') && el.currentStyle['display'] == 'none');
\r
6020 el.querySelector("[att-pane-accessibility]").focus();
\r
6031 .directive('sideRow', [function(){
\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
6041 Reset the sidePaneId array if a new
\r
6042 set of ngRepeat data appeared
\r
6044 sidePaneCtrl.sidePaneIds = [];
\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
6056 .controller('SidePaneCtrl',['$scope', '$element','animation', 'paneGroupConstants',
\r
6057 function($scope,$element,animation, paneGroupConstants){
\r
6058 this.getElement = function(){
\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
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
6076 this.currentSelectedRowPaneId = paneId;
\r
6077 this.sidePaneTracker[paneId] = [];
\r
6083 this.getSidePanesList = function(){
\r
6084 return this.sidePaneTracker[this.currentSelectedRowPaneId];
\r
6086 this.addToSidePanesList = function(newPaneId){
\r
6087 if(this.sidePaneTracker[this.currentSelectedRowPaneId] === undefined){
\r
6088 this.sidePaneTracker[this.currentSelectedRowPaneId] = [];
\r
6090 else if(newPaneId){
\r
6091 this.sidePaneTracker[this.currentSelectedRowPaneId].push(newPaneId);
\r
6094 this.setWidth = function(val){
\r
6096 this.currentWidth = val;
\r
6098 animation.set($element,{width:this.currentWidth});
\r
6100 this.resizeWidth = function(val){
\r
6102 this.currentWidth = val;
\r
6104 animation.to($element,.5,{width:val});
\r
6108 .directive('sidePane', ['paneGroupConstants', function(paneGroupConstants){
\r
6113 templateUrl: 'app/scripts/ng_js_att_tpls/paneSelector/sidePane.html',
\r
6114 require: ['^paneGroup', 'sidePane'],
\r
6115 controller: 'SidePaneCtrl',
\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
6124 .directive('drillDownRow', ['$parse', 'paneGroupConstants',function($parse,paneGroupConstants){
\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
6137 element[0].focus();
\r
6142 .controller('InnerPaneCtrl', ['$scope', '$element','animation', 'paneGroupConstants',
\r
6143 function($scope,$element,animation,paneGroupConstants){
\r
6144 this.getElement = function(){
\r
6147 this.paneId = $scope.paneId;
\r
6149 this.currentWidth = paneGroupConstants.INNER_PANE_DEFAULT;
\r
6150 this.setWidth = function(val){
\r
6152 this.currentWidth = val;
\r
6154 animation.set($element,{width:this.currentWidth});
\r
6156 this.resizeWidth = function(val,callback){
\r
6157 animation.to($element,.25,{width:val,onComplete: callback});
\r
6159 this.displayNone = function(){
\r
6160 animation.set($element, {display:'none'});
\r
6162 this.displayBlock = function(){
\r
6163 animation.set($element,{display:'block'});
\r
6165 this.hideRightBorder();
\r
6168 this.floatLeft = function(){
\r
6169 animation.set($element,{float:'left'});
\r
6171 this.hideLeftBorder = function(){
\r
6172 animation.set($element, {borderLeftWidth: '0px'});
\r
6174 this.showLeftBorder = function(){
\r
6175 animation.set($element,{borderLeftWidth: '1px'});
\r
6177 this.hideRightBorder = function(){
\r
6178 animation.set($element,{borderRightWidth: '0px'});
\r
6180 this.showRightBorder = function(){
\r
6181 animation.set($element, {borderRightWidth: '1px'});
\r
6183 this.slideFromRight = function(){
\r
6184 animation.set($element, {float:'right'});
\r
6185 animation.set($element, {width: this.currentWidth});
\r
6187 this.startOpen = function(){
\r
6188 return $scope.startOpen;
\r
6191 .directive('innerPane', function(){
\r
6196 templateUrl: 'app/scripts/ng_js_att_tpls/paneSelector/innerPane.html',
\r
6197 require: ['^paneGroup', 'innerPane'],
\r
6198 controller: 'InnerPaneCtrl',
\r
6202 link: function(scope,element,attr,ctrls){
\r
6203 if(attr.startOpen === ""){
\r
6204 scope.startOpen = true;
\r
6206 var paneGroupCtrl = ctrls[0];
\r
6207 var innerPaneCtrl = ctrls[1];
\r
6208 paneGroupCtrl.addPaneCtrl(scope.paneId,innerPaneCtrl);
\r
6212 .controller('PaneGroupCtrl', ['$scope', '$element', 'paneGroupConstants',function($scope,$element,paneGroupConstants){
\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
6221 //Show the other panes that may be set to startOpen
\r
6222 //numOpen starts at 1 because of the side pane
\r
6225 for(key in this.panes){
\r
6226 if(this.panes[key].startOpen && this.panes[key].startOpen()){
\r
6232 width = ((100/numOpen)) + '%';
\r
6234 if(this.panes[sidePane.currentSelectedRowPaneId])
\r
6237 sidePane.setWidth(width);
\r
6238 this.panes[sidePane.currentSelectedRowPaneId].setWidth(width);
\r
6241 sidePane.setWidth();
\r
6242 this.panes[sidePane.currentSelectedRowPaneId].setWidth();
\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
6249 this.panes[key].drillDownTo = sidePane.drillDownToMapper[key];
\r
6252 openOtherPanesOnStart(sidePane, this.panes);
\r
6255 function openOtherPanesOnStart(sidePane, panes){
\r
6256 //Build an array of the panes that need to be out
\r
6257 var otherPanesStartOpened = [];
\r
6259 for(index in sidePane.sidePaneRows){
\r
6260 if (sidePane.sidePaneRows.hasOwnProperty(index)) {
\r
6261 var pane = sidePane.sidePaneRows[index];
\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
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
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
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
6301 pane.displayNone();
\r
6306 if(this.panes[paneGroupConstants.SIDE_PANE_ID]){
\r
6307 this.panes[paneGroupConstants.SIDE_PANE_ID].setWidth(paneGroupConstants.SIDE_WIDTH_DEFAULT);
\r
6311 this.addPaneCtrl = function(paneId,paneCtrl){
\r
6312 this.panes[paneId] = paneCtrl;
\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
6320 if(isFromSidePane){
\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
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
6331 this.panes[paneId].slideFromRight();
\r
6332 this.panes[paneId].displayBlock();
\r
6334 this.panes[paneId].setWidth(paneGroupConstants.INNER_PANE_DEFAULT);
\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
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
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
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
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
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
6383 if(!isPaneInStack && this.panes[paneGroupConstants.SIDE_PANE_ID]){
\r
6384 this.panes[paneGroupConstants.SIDE_PANE_ID].addToSidePanesList(paneId);
\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
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
6395 var slideInPaneId;
\r
6397 if(this.panes[paneGroupConstants.SIDE_PANE_ID]){
\r
6398 slideInPaneId = this.panes[paneGroupConstants.SIDE_PANE_ID].getSidePanesList()[sidePanesListLength - 1];
\r
6403 if(that.panes[paneGroupConstants.SIDE_PANE_ID]){
\r
6404 panesList = that.panes[paneGroupConstants.SIDE_PANE_ID].getSidePanesList();
\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
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
6423 this.panes[this.panes[paneGroupConstants.SIDE_PANE_ID].currentSelectedRowPaneId].resizeWidth(widthToSet,function(){
\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
6438 this.slideOutPane = function(paneId,isFromSidePane){
\r
6439 this._slideOutPane(paneId,isFromSidePane);
\r
6442 .directive('paneGroup', ['$timeout',function($timeout){
\r
6447 templateUrl: 'app/scripts/ng_js_att_tpls/paneSelector/paneGroup.html',
\r
6450 controller: 'PaneGroupCtrl',
\r
6451 link: function(scope,element,attr,ctrl){
\r
6452 $timeout(initialize,100);
\r
6453 function initialize(){
\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
6466 appendToBody: true
\r
6470 * The $tooltip service creates tooltip- and popover-like directives as well as
\r
6471 * houses global options for them.
\r
6473 .provider('$tooltip', ['tooltipDefaultOptions', function(tooltipDefaultOptions) {
\r
6475 // Default hide triggers for each show trigger
\r
6476 var triggerMap = {
\r
6477 'mouseenter': 'mouseleave',
\r
6480 'mouseover':'mouseout'
\r
6483 // The options specified to the provider globally.
\r
6484 var globalOptions = {};
\r
6486 this.options = function(value) {
\r
6487 angular.extend(globalOptions, value);
\r
6491 * This allows you to extend the set of trigger mappings available. E.g.:
\r
6493 * $tooltipProvider.setTriggers( 'openTrigger': 'closeTrigger' );
\r
6495 this.setTriggers = function(triggers) {
\r
6496 angular.extend(triggerMap, triggers);
\r
6500 * This is a helper function for translating camel-case to snake-case.
\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
6511 * Returns the actual instance of the $tooltip service.
\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
6517 * Returns an object of show and hide triggers.
\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
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
6530 function getTriggers(trigger) {
\r
6531 var show = trigger || options.trigger || defaultTriggerShow;
\r
6532 var hide = triggerMap[show] || show;
\r
6539 var directiveName = snakeCase(type);
\r
6541 var startSym = $interpolate.startSymbol();
\r
6542 var endSym = $interpolate.endSymbol();
\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
6553 var isElementHovered = false;
\r
6554 element.bind('mouseenter', function(){
\r
6555 isElementHovered = true;
\r
6556 element.removeAttr('title');
\r
6558 element.bind('mouseleave', function(){
\r
6559 isElementHovered = false;
\r
6560 // setTooltipAriaLabel();
\r
6563 /* We store our attributes on our scope so any user of $tooltip service can access attributes */
\r
6564 scope.parentAttrs = attrs;
\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
6576 var tooltip = $compile(template)(scope);
\r
6577 var transitionTimeout;
\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
6587 // By default, the tooltip is not open.
\r
6588 // add ability to start tooltip opened
\r
6589 scope.tt_isOpen = false;
\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
6598 function toggleTooltipBind() {
\r
6599 if (!scope.tt_isOpen) {
\r
6600 showTooltipBind();
\r
6602 hideTooltipBind();
\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
6611 if (scope.tt_popupDelay) {
\r
6612 popupTimeout = $timeout(show, scope.tt_popupDelay);
\r
6614 scope.$apply(show);
\r
6618 function hideTooltipBind() {
\r
6619 scope.$apply(function() {
\r
6624 // Show the tooltip popup element.
\r
6631 // Don't show empty tooltips.
\r
6632 if (!scope.tt_content) {
\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
6642 // Set the initial positioning.
\r
6643 tooltip.css({top: 0, left: 0, display: 'block', 'z-index': 9999});
\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
6651 element.after(tooltip);
\r
6654 // Get the position of the directive element.
\r
6655 position = appendToBody ? $position.offset(element) : $position.position(element);
\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
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
6668 top: position.top + position.height / 2 - ttHeight / 2,
\r
6669 left: (position.left + position.width) + tooltipOffset
\r
6673 top: position.top + position.height / 2 - ttHeight / 2,
\r
6674 left: (position.left + position.width + ttArrowOffset) + tooltipOffset
\r
6681 top: (position.top + position.height) + tooltipOffset,
\r
6682 left: position.left + position.width / 2 - ttWidth / 2
\r
6686 top: (position.top + position.height + ttArrowOffset) + tooltipOffset,
\r
6687 left: position.left + position.width / 2 - ttWidth / 2
\r
6694 top: position.top + position.height / 2 - ttHeight / 2,
\r
6695 left: (position.left - ttWidth) - tooltipOffset
\r
6699 top: position.top + position.height / 2 - ttHeight / 2,
\r
6700 left: (position.left - ttWidth - ttArrowOffset) - tooltipOffset
\r
6707 top: (position.top - ttHeight) - tooltipOffset,
\r
6708 left: position.left + position.width / 2 - ttWidth / 2
\r
6712 top: (position.top - ttHeight - ttArrowOffset) - tooltipOffset,
\r
6713 left: position.left + position.width / 2 - ttWidth / 2
\r
6719 ttPosition.top += 'px';
\r
6720 ttPosition.left += 'px';
\r
6722 // Now set the calculated positioning.
\r
6723 tooltip.css(ttPosition);
\r
6725 // And show the tooltip.
\r
6726 scope.tt_isOpen = true;
\r
6729 // Hide the tooltip popup element.
\r
6731 // First things first: we don't show it anymore.
\r
6732 scope.tt_isOpen = false;
\r
6734 //if tooltip is going to be shown after delay, we must cancel this
\r
6735 $timeout.cancel(popupTimeout);
\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
6745 $attElementDetach(tooltip[0]);
\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
6755 element.attr('title', scope.tt_content);
\r
6761 * Observe the relevant attributes.
\r
6763 attrs.$observe(type, function(val) {
\r
6765 scope.tt_content = val;
\r
6766 // setTooltipAriaLabel();
\r
6768 if (scope.tt_isOpen) {
\r
6774 attrs.$observe(prefix + 'Title', function(val) {
\r
6775 scope.tt_title = val;
\r
6778 attrs.$observe(prefix + 'Placement', function(val) {
\r
6779 scope.tt_placement = angular.isDefined(val) ? val : options.placement;
\r
6782 attrs.$observe(prefix + 'Style', function(val) {
\r
6783 scope.tt_style = angular.isDefined(val) ? val : options.stylett;
\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
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
6797 attrs.$observe(prefix + 'Trigger', function(val) {
\r
6799 if (hasRegisteredTriggers) {
\r
6800 element.unbind(triggers.show, showTooltipBind);
\r
6801 element.unbind(triggers.hide, hideTooltipBind);
\r
6804 triggers = getTriggers(val);
\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
6814 } else if (triggers.show === triggers.hide) {
\r
6815 element.bind(triggers.show, toggleTooltipBind);
\r
6817 element.bind(triggers.show, showTooltipBind);
\r
6818 element.bind(triggers.hide, hideTooltipBind);
\r
6821 hasRegisteredTriggers = true;
\r
6824 attrs.$observe(prefix + 'AppendToBody', function (val) {
\r
6825 appendToBody = angular.isDefined(val) ? $parse(val)(scope) : appendToBody;
\r
6828 attrs.$observe(prefix + 'Offset', function (val) {
\r
6829 tooltipOffset = angular.isDefined(val) ? parseInt(val, 10) : 0;
\r
6832 attrs.$observe(prefix + 'AriaLabel', function (val) {
\r
6833 if (angular.isDefined(val)) {
\r
6834 scope.tooltipAriaLabel = val;
\r
6835 tooltipAriaLabelDefined = true;
\r
6837 tooltipAriaLabelDefined = false;
\r
6839 setTooltipAriaLabel();
\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
6845 if (appendToBody) {
\r
6846 scope.$on('$locationChangeSuccess', function() {
\r
6847 if (scope.tt_isOpen) {
\r
6853 // Make sure tooltip is destroyed and removed.
\r
6854 scope.$on('$destroy', function() {
\r
6855 if (scope.tt_isOpen) {
\r
6867 .directive('tooltipPopup', ['$document', '$documentBind', function($document, $documentBind) {
\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
6878 elem.bind('click', function (e) {
\r
6879 e.stopPropagation();
\r
6881 var outsideClick = function() {
\r
6882 scope.$apply(function() {
\r
6883 scope.isOpen = false;
\r
6887 $documentBind.event('click', 'isOpen', outsideClick, scope, true, 10);
\r
6892 .directive('tooltip', ['$tooltip', function($tooltip) {
\r
6893 return $tooltip('tooltip', 'tooltip', 'mouseenter');
\r
6896 .directive('tooltipCondition', [ '$timeout',function($timeout) {
\r
6901 tooltipCondition:"@?"
\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
6915 else if(scope.tooltipCondition.length>=25){
\r
6916 scope.showpop=true;
\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
6925 .directive('popoverPopup', ['$document', '$documentBind', '$timeout', 'events', 'DOMHelper', function($document, $documentBind, $timeout, events, DOMHelper) {
\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
6934 scope.closeable = false;
\r
6936 scope.closeable = scope.$parent.parentAttrs['closeable'] === '' ? true : false;
\r
6939 /* Before opening modal, find the focused element */
\r
6940 var launchingElement = undefined,
\r
6941 firstTabableElement = undefined;
\r
6943 var outsideClick = function(evt) {
\r
6944 scope.$apply(function() {
\r
6945 scope.isOpen = false;
\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
6957 $timeout(function() {
\r
6958 firstTabableElement = DOMHelper.firstTabableElement(elem);
\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
6967 firstTabableElement.focus();
\r
6971 if (angular.isDefined(launchingElement)) {
\r
6973 launchingElement.focus();
\r
6974 } catch (e) {} /* IE8 will throw exception */
\r
6979 scope.$watch("stylett", function(value) {
\r
6980 scope.popOverStyle = value;
\r
6983 scope.$watch("placement", function(value) {
\r
6984 scope.popOverPlacement = value;
\r
6987 scope.closeMe = function(){
\r
6988 scope.isOpen = false;
\r
6991 elem.bind('click', function (e) {
\r
6992 events.stopPropagation(e);
\r
6995 $documentBind.event('click', 'isOpen', outsideClick, scope, true, 10);
\r
6996 $documentBind.event('keydown', 'isOpen', escKeydown, scope, true, 10);
\r
7001 angular.module('att.abs.profileCard', [])
\r
7002 .constant('profileStatus',{
\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
7010 role:"COMPANY ADMINISTRATOR"
\r
7012 .directive('profileCard',['$http','$q','profileStatus', function($http,$q,profileStatus) {
\r
7016 templateUrl:function(element, attrs){
\r
7017 if(!attrs.addUser){
\r
7018 return 'app/scripts/ng_js_att_tpls/profileCard/profileCard.html';
\r
7021 return 'app/scripts/ng_js_att_tpls/profileCard/addUser.html';
\r
7027 link: function(scope, elem, attr){
\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
7035 image.onload = function() {
\r
7036 deferred.resolve(true);
\r
7038 if(src!==undefined && src.length>0 ){
\r
7041 deferred.reject(false);
\r
7043 return deferred.promise;
\r
7045 if(!attr.addUser){
\r
7046 scope.image=false;
\r
7047 isImage(scope.profile.img).then(function(img) {
\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
7055 if(scope.profile.role.toUpperCase()===profileStatus.role){
\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
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
7070 scope.profile.lastLogin="Today";
\r
7073 scope.profile.lastLogin="Yesterday";
\r
7079 angular.module('att.abs.progressBars', [])
\r
7081 .directive('attProgressBar', [function(){
\r
7085 templateUrl : 'app/scripts/ng_js_att_tpls/progressBars/progressBars.html'
\r
7088 angular.module('att.abs.radio', [])
\r
7089 .constant('attRadioConfig', {
\r
7090 activeClass : "att-radio--on",
\r
7091 disabledClass : "att-radio--disabled"
\r
7093 .directive('attRadio', ['$compile','attRadioConfig', function ($compile, attRadioConfig) {
\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
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
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
7121 radioElm.on('blur', function() {
\r
7122 elm.css("outline","none");
\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
7131 scope.updateModel = function () {
\r
7132 radioElm[0].focus();
\r
7133 var isActive = elm.hasClass(attRadioConfig.activeClass);
\r
7135 if (!isActive && !scope.disabled) {
\r
7136 ngCtrl.$setViewValue(isActive ? null : attr.attRadio);
\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
7147 elm.removeClass(attRadioConfig.disabledClass);
\r
7148 elm.attr("tabindex", "0");
\r
7154 angular.module('att.abs.scrollbar', ['att.abs.position'])
\r
7156 .constant('attScrollbarConstant', {
\r
7158 // Vertical or horizontal scrollbar? ( x || y ).
\r
7160 // Whether navigation pane is required of not.
\r
7161 navigation: false,
\r
7162 // Enable or disable the mousewheel.
\r
7164 // How many pixels must the mouswheel scroll at a time.
\r
7166 // Lock default scrolling window when there is no more content.
\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
7172 // Set the size of the thumb to auto or a fixed number.
\r
7174 // Set to false to hide the scrollbar if not being used
\r
7175 alwaysVisible: true
\r
7179 .directive('attScrollbar', ['$window', '$timeout', '$parse', '$animate', 'attScrollbarConstant', '$position', function ($window, $timeout, $parse, $animate, attScrollbarConstant, $position) {
\r
7184 templateUrl: 'app/scripts/ng_js_att_tpls/scrollbar/scrollbar.html',
\r
7185 controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {
\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
7197 var options = $attrs.scrollbar;
\r
7199 options = $parse(options)($scope);
\r
7203 this.options = angular.extend({}, defaults, options);
\r
7204 this._defaults = defaults;
\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
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
7243 this.initialize = function () {
\r
7244 if (!this.options.alwaysVisible) {
\r
7245 $scrollbar.css('opacity', 0);
\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
7261 this.update = function (scrollTo) {
\r
7262 self.setSizeData();
\r
7263 mousePosition = $scrollbar.prop('offsetTop');
\r
7265 $scrollbar.toggleClass('disable', this.contentRatio >= 1 || isNaN(this.contentRatio));
\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
7275 if (scrollTo !== null) {
\r
7276 if (scrollTo === 'bottom') {
\r
7277 this.contentPosition = this.contentSize - this.viewportSize;
\r
7279 this.contentPosition = parseInt(scrollTo, 10) || 0;
\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
7292 fireEvent = function (obj, evt) {
\r
7293 var fireOnThis = obj;
\r
7295 if (document.createEvent) {
\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
7302 evtObj = document.createEventObject();
\r
7303 fireOnThis.fireEvent('on' + evt, evtObj);
\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
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
7317 if (self.contentPosition <= 0) {
\r
7318 $scope.prevAvailable = false;
\r
7320 $scope.prevAvailable = true;
\r
7323 if (self.contentPosition >= (self.contentSize - self.viewportSize)) {
\r
7324 $scope.nextAvailable = false;
\r
7326 $scope.nextAvailable = true;
\r
7330 function setEvents() {
\r
7331 if (hasTouchEvents) {
\r
7332 $viewport.on('touchstart', touchstart);
\r
7333 $thumb.on('touchstart', touchstart);
\r
7335 $thumb.on('mousedown', start);
\r
7336 $scrollbar.on('mousedown', drag);
\r
7339 angular.element($window).on('resize', resize);
\r
7341 if (self.options.wheel) {
\r
7342 $element.on(wheelEvent, wheel);
\r
7346 function resize() {
\r
7350 function touchstart(event) {
\r
7351 if (1 === event.touches.length) {
\r
7352 event.stopPropagation();
\r
7353 start(event.touches[0]);
\r
7357 function start(event) {
\r
7358 $body.addClass('scroll-no-select');
\r
7359 $element.addClass('scroll-no-select');
\r
7361 if (!self.options.alwaysVisible) {
\r
7362 $scrollbar.addClass('visible');
\r
7364 mousePosition = isHorizontal ? event.clientX : event.clientY;
\r
7365 self.thumbPosition = parseInt($thumb.css(posiLabel), 10) || 0;
\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
7375 $document.on('mousemove', drag);
\r
7376 $document.on('mouseup', end);
\r
7377 $thumb.on('mouseup', end);
\r
7381 function wheel(event) {
\r
7382 if (self.contentRatio >= 1) {
\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
7391 $scrollbar.addClass('visible');
\r
7393 restoreVisibilityAfterWheel = $timeout(function () {
\r
7394 $scrollbar.removeClass('visible');
\r
7398 var evntObj = (event && event.originalEvent) || event || $window.event,
\r
7399 deltaDir = self.options.axis.toUpperCase(),
\r
7401 X: evntObj.deltaX || 0,
\r
7402 Y: evntObj.deltaY || 0
\r
7404 wheelSpeed = evntObj.deltaMode === 0 ? self.options.wheelSpeed : 1;
\r
7406 if (self.options.scrollInvert) {
\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
7416 delta.X *= -1 / wheelSpeed;
\r
7417 delta.Y *= -1 / wheelSpeed;
\r
7419 var wheelSpeedDelta = delta[deltaDir];
\r
7421 self.contentPosition -= wheelSpeedDelta * self.options.wheelSpeed;
\r
7422 self.contentPosition = Math.min((self.contentSize - self.viewportSize), Math.max(0, self.contentPosition));
\r
7424 fireEvent($element[0], 'move');
\r
7426 ensureContentPosition();
\r
7427 $thumb.css(posiLabel, self.contentPosition / self.trackRatio + 'px');
\r
7428 $overview.css(posiLabel, -self.contentPosition + 'px');
\r
7430 if (self.options.wheelLock || (self.contentPosition !== (self.contentSize - self.viewportSize) && self.contentPosition !== 0)) {
\r
7431 evntObj.preventDefault();
\r
7437 function touchdrag(event) {
\r
7438 event.preventDefault();
\r
7439 documnetscrolltouch = true;
\r
7440 drag(event.touches[0]);
\r
7443 function touchdragthumb(event) {
\r
7444 event.preventDefault();
\r
7445 thumbscrolltouch = true;
\r
7446 drag(event.touches[0]);
\r
7449 function drag(event) {
\r
7450 if (self.contentRatio >= 1) {
\r
7454 var mousePositionNew = isHorizontal ? event.clientX : event.clientY,
\r
7455 thumbPositionDelta = mousePositionNew - mousePosition;
\r
7457 if ((self.options.scrollInvert && !hasTouchEvents) ||
\r
7458 (hasTouchEvents && !self.options.scrollInvert)) {
\r
7459 thumbPositionDelta = mousePosition - mousePositionNew;
\r
7461 if (documnetscrolltouch && hasTouchEvents) {
\r
7462 thumbPositionDelta = mousePosition - mousePositionNew;
\r
7464 if (thumbscrolltouch && hasTouchEvents) {
\r
7465 thumbPositionDelta = mousePositionNew - mousePosition;
\r
7467 var thumbPositionNew = Math.min((self.trackSize - self.thumbSize), Math.max(0, self.thumbPosition + thumbPositionDelta));
\r
7468 self.contentPosition = thumbPositionNew * self.trackRatio;
\r
7470 fireEvent($element[0], 'move');
\r
7472 ensureContentPosition();
\r
7473 $thumb.css(posiLabel, thumbPositionNew + 'px');
\r
7474 $overview.css(posiLabel, -self.contentPosition + 'px');
\r
7479 $scope.customScroll = function (direction) {
\r
7480 if (self.contentRatio >= 1) {
\r
7484 var customScrollDelta;
\r
7485 var viewportDimension = $position.position($viewport);
\r
7487 if (isHorizontal) {
\r
7488 customScrollDelta = viewportDimension.width;
\r
7490 customScrollDelta = viewportDimension.height;
\r
7494 self.contentPosition += customScrollDelta;
\r
7496 self.contentPosition -= customScrollDelta;
\r
7498 self.contentPosition = Math.min((self.contentSize - self.viewportSize), Math.max(0, self.contentPosition));
\r
7500 fireEvent($element[0], 'move');
\r
7502 ensureContentPosition();
\r
7503 $thumb.css(posiLabel, self.contentPosition / self.trackRatio + 'px');
\r
7504 $overview.css(posiLabel, -self.contentPosition + 'px');
\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
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
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
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
7546 var position = iElement.css('position');
\r
7547 if (position !== 'relative' && position !== 'absolute') {
\r
7548 iElement.css('position', 'relative');
\r
7551 scope.$watch(function () {
\r
7552 $timeout(refreshScrollbar, 100, false);
\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
7565 controller.initialize();
\r
7566 iElement.on('$destroy', function () {
\r
7567 controller.cleanup();
\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
7577 scope:{cName: '=attSearch'},
\r
7578 transclude: 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
7590 // This is used to jump to elements in list
\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
7598 $timeout(function() {
\r
7599 list = element.find('li');
\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
7607 scope.noFilter = false;
\r
7609 if (attr.placeholderAsOption === 'false') {
\r
7610 //scope.selectMsg = '';
\r
7611 scope.selectedOption = attr.placeholder;
\r
7613 scope.selectMsg = attr.placeholder;
\r
7615 if (attr.startsWithFilter || attr.startsWithFilter === 'true') {
\r
7616 scope.startsWithFilter = true;
\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
7623 if (attr.disabled) {
\r
7624 scope.isDisabled = true;
\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
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
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
7646 if ((i >= scope.cName.length || !scope.cName[i+1].title.startsWith(criteria)) && prevIndex > 0) {
\r
7650 scope.showDropdown = function() {
\r
7651 if (!(attr.disabled)) {
\r
7652 scope.showlist = !scope.showlist;
\r
7653 scope.setSelectTop();
\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
7661 switch (e.keyCode) {
\r
7662 case keymap.KEY.DOWN:
\r
7663 scope.selectNext();
\r
7665 case keymap.KEY.UP:
\r
7666 scope.selectPrev();
\r
7669 case keymap.KEY.ENTER:
\r
7670 scope.selectCurrent();
\r
7673 case keymap.KEY.BACKSPACE:
\r
7678 case keymap.KEY.SPACE:
\r
7679 if (!scope.noFilter) {
\r
7680 scope.title += ' ';
\r
7684 case keymap.KEY.ESC:
\r
7685 if (scope.title === '' || scope.title === undefined) {
\r
7686 scope.showlist = false;
\r
7687 dropdownElement.focus();
\r
7693 if (scope.noFilter) {
\r
7695 dropdownElement.focus();
\r
7696 scope.showlist = false;
\r
7703 if (e.keyCode !== 9)
\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
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
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
7719 selectOptionFromSearch();
\r
7722 } else if (e.keyCode === 9) {
\r
7723 scope.showlist = false;
\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
7736 scope.selectedOption = scope.selectMsg;
\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
7749 scope.showlist = false;
\r
7750 dropdownElement.focus();
\r
7754 scope.selectCurrent = function() {
\r
7755 if (scope.showlist) {
\r
7756 scope.selectOption(scope.selectMsg, scope.selectedIndex, false);
\r
7759 scope.showlist = true;
\r
7760 scope.setSelectTop();
\r
7764 scope.hoverIn = function(cItem) {
\r
7765 scope.selectedIndex = cItem;
\r
7768 scope.setSelectTop = function() {
\r
7769 $timeout(function() {
\r
7770 if (scope.showlist && !scope.noFilter)
\r
7772 var containerUL = angular.element(element)[0].querySelector(".select2-results");
\r
7773 if(angular.element(containerUL.querySelector('.select2-result-current'))[0])
\r
7775 var selectedElemTopPos = angular.element(containerUL.querySelector('.select2-result-current'))[0].offsetTop;
\r
7777 angular.element(containerUL)[0].scrollTop = selectedElemTopPos;
\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
7787 var selectedElemTopPos = angular.element(containerUL.querySelector('.hovstyle'))[0].offsetTop;
\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
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
7807 scope.setCurrentTop();
\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
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
7822 scope.selectedIndex = 0;
\r
7824 if (!scope.showlist) {
\r
7825 scope.selectOption(scope.selectMsg, scope.selectedIndex, false);
\r
7830 scope.setCurrentTop();
\r
7832 scope.updateSelection = function(sItem) {
\r
7833 scope.selectedOption = sItem.title;
\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
7843 if (angular.isDefined(list[index])) {
\r
7844 list[index].focus();
\r
7848 scope.$watch('selCategory', function(value) {
\r
7850 scope.updateSelection(value);
\r
7853 ctrl.$viewChangeListeners.push(function() {
\r
7854 scope.$eval(attr.ngChange);
\r
7856 ctrl.$render = function() {
\r
7857 scope.selCategory = ctrl.$viewValue;
\r
7859 var outsideClick = function(e) {
\r
7860 var isElement = $isElement(angular.element(e.target), element, $document);
\r
7862 scope.showlist = false;
\r
7863 dropdownElement.focus();
\r
7867 $documentBind.click('showlist', outsideClick, scope);
\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
7876 cName: '=attSelect'
\r
7878 transclude: 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
7894 // This is used to jump to elements in list
\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
7902 $timeout(function() {
\r
7903 list = element.find('li');
\r
7905 //scope.noFilter = true;
\r
7906 if (attr.noFilter || attr.noFilter === 'true') {
\r
7907 scope.noFilter = true;
\r
7909 scope.noFilter = false;
\r
7911 if (attr.placeholderAsOption === 'false') {
\r
7912 scope.selectedOption = attr.placeholder;
\r
7914 scope.selectMsg = attr.placeholder;
\r
7916 if (attr.startsWithFilter || attr.startsWithFilter === 'true') {
\r
7917 scope.startsWithFilter = true;
\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
7924 if (attr.disabled) {
\r
7925 scope.isDisabled = true;
\r
7927 var getFilterType = function() {
\r
7928 if (scope.startsWithFilter) {
\r
7929 return 'startsWith';
\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
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
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
7954 if ((i >= scope.cName.length || !scope.cName[i+1].title.startsWith(criteria)) && prevIndex > 0) {
\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
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
7971 switch (e.keyCode) {
\r
7972 case keymap.KEY.DOWN:
\r
7973 scope.selectNext();
\r
7975 case keymap.KEY.UP:
\r
7976 scope.selectPrev();
\r
7979 case keymap.KEY.ENTER:
\r
7980 scope.selectCurrent();
\r
7983 case keymap.KEY.BACKSPACE:
\r
7988 case keymap.KEY.SPACE:
\r
7989 if (!scope.noFilter) {
\r
7990 scope.title += ' ';
\r
7994 case keymap.KEY.ESC:
\r
7995 if (scope.title === '' || scope.title === undefined) {
\r
7996 scope.showlist = false;
\r
7997 dropdownElement.focus();
\r
8003 if (scope.noFilter) {
\r
8005 dropdownElement.focus();
\r
8006 scope.showlist = false;
\r
8013 if (e.keyCode !== keymap.KEY.TAB)
\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
8019 /* Perform index correction */
\r
8020 if (scope.title != '') {
\r
8021 var filteredArray = $filter(getFilterType())(scope.cName, scope.title);
\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
8028 if (filteredArray[i]['title'] === scope.cName[scope.selectedIndex]['title']) {
\r
8029 scope.selectedIndex = i;
\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
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
8047 selectOptionFromSearch();
\r
8050 } else if (e.keyCode === keymap.KEY.TAB) {
\r
8051 scope.showlist = false;
\r
8057 scope.selectOption = function(sTitle, sIndex, keepOpen) {
\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
8065 scope.selectedOption = scope.selectMsg;
\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
8073 if (angular.isDefined(filteredArray) && angular.isDefined(filteredArray[sIndex]))
\r
8075 for (var i = 0; i < scope.cName.length; i++) {
\r
8076 if (filteredArray[sIndex]['title'] === scope.cName[i]['title']) {
\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
8089 $timeout(function(){
\r
8090 if (angular.isDefined(list[sIndex])) {
\r
8092 list[index].focus();
\r
8093 } catch (e) {} /* IE8 will throw exception if display:none or not in DOM */
\r
8099 scope.showlist = false;
\r
8100 dropdownElement.focus();
\r
8103 scope.selectCurrent = function() {
\r
8104 if (scope.showlist) {
\r
8105 scope.selectOption(scope.selectMsg,scope.selectedIndex,false);
\r
8107 scope.showlist = true;
\r
8108 scope.setSelectTop();
\r
8112 scope.hoverIn = function(cItem) {
\r
8113 scope.selectedIndex = cItem;
\r
8116 scope.setSelectTop = function() {
\r
8117 $timeout(function() {
\r
8118 if (scope.showlist && !scope.noFilter)
\r
8120 var containerUL = angular.element(element)[0].querySelector(".select2-results");
\r
8121 if(angular.element(containerUL.querySelector('.select2-result-current'))[0])
\r
8123 var selectedElemTopPos = angular.element(containerUL.querySelector('.select2-result-current'))[0].offsetTop;
\r
8125 angular.element(containerUL)[0].scrollTop = selectedElemTopPos;
\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
8135 var selectedElemTopPos = angular.element(containerUL.querySelector('.hovstyle'))[0].offsetTop;
\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
8146 scope.selectNext = function() {
\r
8147 var length = scope.cName.length;
\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
8155 if (!scope.showlist) {
\r
8156 scope.selectOption(scope.selectMsg, scope.selectedIndex,false);
\r
8161 scope.setCurrentTop();
\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
8170 if (!scope.showlist) {
\r
8171 scope.selectOption(scope.selectMsg, scope.selectedIndex,false);
\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
8182 scope.selectedIndex = -1;
\r
8185 scope.selectedIndex = 0;
\r
8187 if (!scope.showlist) {
\r
8188 scope.selectOption(scope.selectMsg, scope.selectedIndex,false);
\r
8193 scope.setCurrentTop();
\r
8195 scope.updateSelection = function(sItem) {
\r
8196 scope.selectedOption = sItem.title;
\r
8199 if (sItem.index < 0) {
\r
8200 scope.selectOption(scope.selectMsg, sItem.index, scope.showlist);
\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
8210 if (angular.isDefined(list[index])) {
\r
8212 list[index].focus();
\r
8213 } catch (e) {} /* IE8 will throw exception if display:none or not in DOM */
\r
8217 scope.$watch('selCategory', function(value) {
\r
8219 scope.updateSelection(value);
\r
8222 ctrl.$viewChangeListeners.push(function() {
\r
8223 scope.$eval(attr.ngChange);
\r
8225 ctrl.$render = function() {
\r
8226 scope.selCategory = ctrl.$viewValue;
\r
8228 var outsideClick = function(e) {
\r
8229 var isElement = $isElement(angular.element(e.target), element, $document);
\r
8231 scope.showlist = false;
\r
8232 dropdownElement.focus();
\r
8236 $documentBind.click('showlist', outsideClick, scope);
\r
8240 .directive('textDropdown', ['$document', '$isElement', '$documentBind', "keymap", function($document, $isElement, $documentBind, keymap) {
\r
8245 actions: '=actions',
\r
8246 defaultAction: '=defaultAction',
\r
8247 onActionClicked: '=?'
\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
8260 dropdownElement = element.find('div')[0];
\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
8276 scope.currentAction = scope.actions[0];
\r
8278 scope.toggle = function() {
\r
8279 scope.isActionsShown = !scope.isActionsShown;
\r
8281 scope.chooseAction = function($event, action, $index) {
\r
8282 if ($event != null) {
\r
8283 scope.currentAction = action;
\r
8284 scope.selectedIndex = $index;
\r
8286 scope.currentAction = scope.actions[scope.selectedIndex];
\r
8288 if (angular.isFunction(scope.onActionClicked)) {
\r
8289 scope.onActionClicked(scope.currentAction);
\r
8293 scope.isCurrentAction = function(action) {
\r
8294 return (action === scope.currentAction);
\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
8304 case keymap.KEY.UP:
\r
8305 scope.selectPrev();
\r
8307 case keymap.KEY.ENTER:
\r
8308 scope.selectCurrent();
\r
8310 case keymap.KEY.ESC:
\r
8311 scope.isActionsShown = false;
\r
8312 dropdownElement.focus();
\r
8320 } else if (e.keyCode === keymap.KEY.TAB) {
\r
8321 scope.isActionsShown = false;
\r
8325 scope.selectCurrent = function() {
\r
8326 if (scope.selectedIndex < 0) {
\r
8327 scope.selectedIndex = 0;
\r
8329 if (!scope.isActionsShown) {
\r
8332 scope.chooseAction(null, scope.currentAction);
\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
8340 scope.selectedIndex = (scope.actions.length - 1);
\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
8355 scope.hoverIn = function(cItem) {
\r
8356 scope.selectedIndex = cItem;
\r
8359 var outsideClick = function(e) {
\r
8360 var isElement = $isElement(angular.element(e.target), element, $document);
\r
8366 $documentBind.click('isActionsShown', outsideClick, scope);
\r
8370 angular.module('att.abs.slider', ['att.abs.position'])
\r
8371 .constant('sliderDefaultOptions', {
\r
8375 disabledWidth: 116
\r
8377 .directive('attSlider', ['sliderDefaultOptions','$position','$document', function(sliderDefaultOptions,$position,$document)
\r
8391 ngModelSingle: '=?',
\r
8393 ngModelHigh: '=?',
\r
8394 ngModelDisabled: '=?'
\r
8396 templateUrl: 'app/scripts/ng_js_att_tpls/slider/slider.html',
\r
8397 link: function(scope, elem, attr)
\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
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
8420 singlePtr.remove();
\r
8423 disabledRange.remove();
\r
8426 scope.disabledStyle = {width: disableWidth + 'px', zIndex: 1};
\r
8427 scope.handleStyle = {left: disableWidth + 'px'};
\r
8429 minValue = parseFloat(scope.floor);
\r
8430 maxValue = parseFloat(scope.ceiling);
\r
8431 valueRange = maxValue - minValue;
\r
8433 if (attr.width !== undefined) {
\r
8434 maxOffset = attr.width;
\r
8437 if (elem[0].clientWidth !== 0) {
\r
8438 maxOffset = elem[0].clientWidth;
\r
8441 maxOffset = sliderDefaultOptions.width;
\r
8444 offsetRange = maxOffset - minOffset;
\r
8446 scope.keyDown = function(ev){
\r
8447 if(ev.keyCode === 39){
\r
8448 var elemLeft = $position.position(elem).left;
\r
8450 if(scope.ref === "ngModelLow"){
\r
8451 newOffset1 = sliderDefaultOptions.step + newOffset1;
\r
8452 newOffset = newOffset1;
\r
8454 else if(scope.ref === "ngModelHigh"){
\r
8455 newOffset2 = sliderDefaultOptions.step + newOffset2;
\r
8456 newOffset = newOffset2;
\r
8458 else{newOffset = sliderDefaultOptions.step + newOffset;}
\r
8461 if(range &&scope.ref === "ngModelLow"){
\r
8465 newOffset = sliderDefaultOptions.step + elemLeft;
\r
8466 newOffset1 = newOffset2 = newOffset;
\r
8470 else if(ev.keyCode === 37){
\r
8471 var ptrLeft = $position.position(singlePtr).left;
\r
8473 if (!(newOffset<=0)){
\r
8474 if(scope.ref === "ngModelLow"){
\r
8475 newOffset1 = newOffset1 - sliderDefaultOptions.step;
\r
8476 newOffset = newOffset1;
\r
8478 else if(scope.ref === "ngModelHigh"){
\r
8479 newOffset2 = newOffset2 - sliderDefaultOptions.step;
\r
8480 newOffset = newOffset2;
\r
8483 newOffset = newOffset - sliderDefaultOptions.step;
\r
8484 newOffset1 = newOffset2 = newOffset;
\r
8489 newOffset = ptrLeft - sliderDefaultOptions.step;
\r
8493 scope.ptrOffset(newOffset);
\r
8496 //Mouse Down Event
\r
8497 scope.mouseDown = function(e, ref) {
\r
8503 start_x = e.clientX - newOffset;
\r
8506 start_x = e.clientX;
\r
8509 if (scope.ref === refLow) {
\r
8510 start_x = e.clientX - scope.minPtrOffset;
\r
8513 start_x = e.clientX - scope.maxPtrOffset;
\r
8517 scope.ref= 'ngModelDisabled';
\r
8518 scope.disabledStyle = {width: disableWidth + 'px', zIndex: 1};
\r
8521 // Mouse Move Event
\r
8522 scope.moveElem = function(ev) {
\r
8525 eventX = ev.clientX;
\r
8526 newOffset = eventX - start_x;
\r
8527 scope.ptrOffset(newOffset);
\r
8530 scope.focus=function(ev,ref){
\r
8535 scope.mouseUp = function(ev) {
\r
8537 minPtr.removeClass('dragging');
\r
8538 maxPtr.removeClass('dragging');
\r
8539 singlePtr.removeClass('dragging');
\r
8540 $document.off('mousemove');
\r
8543 scope.keyUp = function(ev) {
\r
8545 minPtr.removeClass('dragging');
\r
8546 maxPtr.removeClass('dragging');
\r
8547 singlePtr.removeClass('dragging');
\r
8548 $document.off('mousemove');
\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
8556 if (step === null) {
\r
8557 step = 1 / Math.pow(10, precision);
\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
8565 //Function to calculate Offset Percent
\r
8566 scope.percentOffset = function(offset) {
\r
8567 return ((offset - minOffset) / offsetRange) * 100;
\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
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
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
8607 rangeSliderWidth = parseInt(scope.maxPtrOffset) - parseInt(scope.minPtrOffset);
\r
8608 scope.rangeStyle = {width: rangeSliderWidth + "px", left: scope.minPtrOffset + "px"};
\r
8611 if (disabled && newOffset > disableWidth) {
\r
8612 scope.rangeStyle = {width: newOffset + "px", zIndex: 0};
\r
8615 singlePtr.addClass('dragging');
\r
8616 scope.rangeStyle = {width: newOffset + "px"};
\r
8618 scope.handleStyle = {left: newOffset + "px"};
\r
8620 if ((scope.precision === undefined) || (scope.step === undefined)) {
\r
8621 scope.precision = sliderDefaultOptions.precision;
\r
8622 scope.step = sliderDefaultOptions.step;
\r
8624 newValue = scope.calStep(newValue, parseInt(scope.precision), parseFloat(scope.step), parseFloat(scope.floor));
\r
8625 scope[scope.ref] = newValue;
\r
8630 ]).directive('attSliderMin',[function()
\r
8633 require: '^attSlider',
\r
8637 templateUrl: 'app/scripts/ng_js_att_tpls/slider/minContent.html'
\r
8640 ]).directive('attSliderMax',[function()
\r
8643 require: '^attSlider',
\r
8647 templateUrl: 'app/scripts/ng_js_att_tpls/slider/maxContent.html'
\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
8656 transclude: true,
\r
8657 templateUrl: 'app/scripts/ng_js_att_tpls/splitButtonDropdown/splitButtonDropdown.html',
\r
8665 controller: ['$scope', '$element', function ($scope, $element) {
\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
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
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
8689 this.childScopes = [];
\r
8690 this.registerScope = function(childScope)
\r
8692 this.childScopes.push(childScope);
\r
8695 this.resetFlag = function(index){
\r
8696 for(var i=0; i < this.childScopes.length; i++)
\r
8700 this.childScopes[i].sFlag = false;
\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
8713 if (!(scope.btnText)) {
\r
8714 scope.isActionDropdown = true;
\r
8717 scope.clickFxn = function () {
\r
8718 if (typeof scope.btnClick === "function" && !scope.btnLink) {
\r
8719 scope.btnClick = $parse(scope.btnClick);
\r
8722 if(scope.multiselect === true)
\r
8724 scope.isDropDownOpen = false;
\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
8739 scope.btnTypeSelector = function (directiveValue, attrValue) {
\r
8740 if (directiveValue !== "") {
\r
8741 scope.btnTypeFinal = directiveValue;
\r
8743 scope.btnTypeFinal = attrValue;
\r
8747 var outsideClick = function(e) {
\r
8748 var isElement = $isElement(angular.element(e.target), element.find('ul').eq(0), $document);
\r
8750 scope.isDropDownOpen = false;
\r
8755 $documentBind.click('isDropDownOpen', outsideClick, scope);
\r
8757 attr.$observe('btnType', function (val) {
\r
8758 scope.btnType = val;
\r
8760 attr.$observe('attButtonDropdown', function (val) {
\r
8761 attr.attButtonDropdown = val;
\r
8762 scope.btnTypeSelector(attr.attButtonDropdown, scope.btnType);
\r
8769 .directive('attButtonDropdownItem', ['$location','keymap', function ($location,keymap) {
\r
8772 require: ['^attButtonDropdown','?ngModel'],
\r
8774 transclude: true,
\r
8775 templateUrl:'app/scripts/ng_js_att_tpls/splitButtonDropdown/splitButtonDropdownItem.html', scope: {
\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
8789 scope.isSelected = ctrl[1].$viewValue;
\r
8791 scope.isSelected = false;
\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
8802 case keymap.KEY.UP:
\r
8803 ctrl[0].focusPrev();
\r
8805 case keymap.KEY.ENTER:
\r
8806 scope.selectItem();
\r
8808 case keymap.KEY.ESC:
\r
8809 ctrl[0].closeAndFocusDropdown();
\r
8819 scope.selectItem = function()
\r
8822 scope.$evalAsync(function(){ctrl[1].$setViewValue(!ctrl[1].$viewValue)});
\r
8830 angular.module('att.abs.splitIconButton', ['att.abs.utilities'])
\r
8831 .constant('iconStateConstants', {
\r
8835 NEXT_TO_DROPDOWN:'next-to-dropdown',
\r
8836 LEFT_NEXT_TO_DROPDOWN:'left-next-to-dropdown',
\r
8842 SPLIT_ICON_BTN_EVENT_EMITTER_KEY: 'splitIconButtonTap'
\r
8844 .directive('expandableLine', [function(){
\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
8855 this.isActive = $scope.isActive;
\r
8856 this.dirType = $scope.dirType;
\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
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
8869 .controller('AttSplitIconCtrl', ['$scope', function($scope){
\r
8870 this.setType = function(type){
\r
8871 $scope.type = type;
\r
8873 this.isDropdown = function(isDropdown){
\r
8874 $scope.isDropdown = isDropdown;
\r
8876 this.dropDownClicked = function(){
\r
8877 if($scope.dropDownClicked) {
\r
8878 $scope.dropDownClicked();
\r
8881 this.dirType = $scope.dirType;
\r
8883 .directive('attSplitIcon', ['$document', '$timeout','iconStateConstants','$documentBind','events', 'keymap',
\r
8884 function($document,$timeout,iconStateConstants,$documentBind, events, keymap){
\r
8890 require: ['^attSplitIconButton','attSplitIcon'],
\r
8891 templateUrl: 'app/scripts/ng_js_att_tpls/splitIconButton/splitIcon.html',
\r
8894 iconTitle: '@title',
\r
8896 dropDownWatch: '=',
\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
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
8916 scope.toggleDropdown(false);
\r
8921 if(attr.dropDownId && attr.dropDownId !== ''){
\r
8922 scope.dropDownId = attr.dropDownId;
\r
8923 scope.isDropdown = true;
\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
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
8932 if(scope.isDropDownOpen) {
\r
8933 listElements[currentIndex].eq(0).find('a')[0].click();
\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
8942 function triggerKeyboardEvents(e) {
\r
8944 case (keymap.KEY.TAB):
\r
8945 scope.toggleDropdown(false);
\r
8948 case (keymap.KEY.ESC):
\r
8951 case (keymap.KEY.ENTER):
\r
8952 if (scope.isDropDownOpen) {
\r
8953 listElementsInit();
\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
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
8971 isMyElement = true;
\r
8973 listElementsInit();
\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
8987 listElements[currentIndex].children().eq(0).addClass('selected-item');
\r
8991 scope.nextItemInDropdown = function(){
\r
8992 if(listElements && currentIndex < listElements.length - 1){
\r
8994 listElements[currentIndex - 1].children().eq(0).removeClass('selected-item');
\r
8995 listElements[currentIndex].children().eq(0).addClass('selected-item');
\r
8998 scope.previousItemInDropdown = function(){
\r
8999 if(currentIndex > 0) {
\r
9001 listElements[currentIndex].children().eq(0).addClass('selected-item');
\r
9003 if(currentIndex + 1 < listElements.length)
\r
9004 listElements[currentIndex + 1].children().eq(0).removeClass('selected-item');
\r
9007 scope.$watch('isIconHovered', function(val) {
\r
9008 scope.hoverWatch = val;
\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
9019 case (scope.iconStateConstants.MIDDLE):
\r
9020 toggleValues(true,false,false,true,false);
\r
9022 case (scope.iconStateConstants.LEFT):
\r
9023 toggleValues(false,false,false,true,false);
\r
9025 case (scope.iconStateConstants.RIGHT):
\r
9026 toggleValues(false,false,true,false,false);
\r
9028 case (scope.iconStateConstants.NEXT_TO_DROPDOWN):
\r
9029 toggleValues(false,true,true,true,false);
\r
9031 case (scope.iconStateConstants.LEFT_NEXT_TO_DROPDOWN):
\r
9032 toggleValues(false,false,false,true,true);
\r
9038 scope.dropDownClicked = function() {
\r
9039 isMyElement = true;
\r
9041 scope.toggleDropdown = function(val) {
\r
9042 if(val !== undefined) {
\r
9043 scope.isDropDownOpen = val;
\r
9045 scope.isDropDownOpen = !scope.isDropDownOpen;
\r
9047 scope.dropDownWatch = scope.isDropDownOpen;
\r
9049 $documentBind.click('isDropdown', outsideClick, scope);
\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
9060 function getDirIndex(dirType) {
\r
9062 for(var c in that.subCtrls) {
\r
9063 var ctrl = that.subCtrls[c];
\r
9064 if(ctrl.dirType === dirType) {
\r
9071 this.addSubCtrl = function(sub) {
\r
9072 this.subCtrls.push(sub);
\r
9074 this.isLeftLineShown = function(isShown) {
\r
9075 if(isShown === undefined) {
\r
9076 return $scope.isLeftLineShown;
\r
9078 $scope.isLeftLineShown = isShown;
\r
9081 this.isRightLineShown = function(isShown) {
\r
9082 if(isShown === undefined) {
\r
9083 return $scope.isRightLineShown;
\r
9085 $scope.isRightLineShown = isShown;
\r
9088 this.setLeftLineHover = function(isHovered) {
\r
9089 var leftLineIndex = getDirIndex(iconStateConstants.DIR_TYPE.LEFT);
\r
9091 if($scope.isLeftLineShown && this.subCtrls[leftLineIndex] && this.subCtrls[leftLineIndex].setActiveState) {
\r
9092 this.subCtrls[leftLineIndex].setActiveState(isHovered);
\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
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
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
9123 if(isDropDownOpen) {
\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
9130 /*if(subIconButtons[subIconButtonsLength-1] === buttonCtrl) {
\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
9143 noVerticalLineToggle();
\r
9145 if($scope.isLeftLineShown) {
\r
9146 this.subCtrls[leftLineIndex].setActiveState(isHovered);
\r
9148 if($scope.isRightLineShown) {
\r
9149 this.subCtrls[rightLineIndex].setActiveState(isHovered);
\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
9158 if($scope.isLeftLineShown && this.subCtrls[leftLineIndex].setActiveState) {
\r
9159 this.subCtrls[leftLineIndex].setActiveState(isHovered);
\r
9161 if($scope.isRightLineShown && this.subCtrls[rightLineIndex].setActiveState){
\r
9162 this.subCtrls[rightLineIndex].setActiveState(isHovered);
\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
9173 .directive('attSplitIconButton', ['$document', 'iconStateConstants', 'keymap',
\r
9174 function($document, iconStateConstants, keymap){
\r
9180 require: ['^attSplitIconButtonGroup', 'attSplitIconButton'],
\r
9181 controller: 'AttSplitIconButtonCtrl',
\r
9182 templateUrl: 'app/scripts/ng_js_att_tpls/splitIconButton/splitIconButton.html',
\r
9188 link: function(scope,element,attr,ctrls) {
\r
9189 if(!scope.title) {
\r
9190 scope.title = scope.icon;
\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
9206 scope.dropDownWatch = false;
\r
9207 scope.iconStateConstants = iconStateConstants;
\r
9208 scope.clickHandler = function() {
\r
9209 attSplitButtonGroupCtrl.hideLeftLineRightButton(attSplitIconButtonCtrl);
\r
9211 scope.$watch('isHovered', function(val){
\r
9213 attSplitIconButtonCtrl.toggleLines(val,attSplitButtonGroupCtrl,attSplitIconButtonCtrl,attSplitButtonGroupCtrl.isDropDownOpen);
\r
9215 attSplitIconButtonCtrl.toggleLines(val,attSplitButtonGroupCtrl,attSplitIconButtonCtrl,attSplitButtonGroupCtrl.isDropDownOpen);
\r
9218 scope.$watch('dropDownWatch', function(val) {
\r
9219 attSplitButtonGroupCtrl.isDropDownOpen = val;
\r
9220 attSplitButtonGroupCtrl.toggleDropdownState(val);
\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
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
9236 if (btn != buttonLeftOfRightMost && btn != rightMostButton ){
\r
9237 rightMostButton.setLeftLineHover(false);
\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
9247 this.subIconButtons[numButtons - 1].setLeftLineHover(true);
\r
9249 this.subIconButtons[numButtons - 2].setButtonType(iconStateConstants.NEXT_TO_DROPDOWN);
\r
9251 this.subIconButtons[numButtons - 1].setLeftLineHover(false);
\r
9252 this.subIconButtons[numButtons - 2].setButtonType(iconStateConstants.MIDDLE);
\r
9255 if(isDropDownOpen) {
\r
9256 this.subIconButtons[0].setRightLineHover(true);
\r
9257 this.subIconButtons[0].setButtonType(iconStateConstants.LEFT_NEXT_TO_DROPDOWN);
\r
9259 this.subIconButtons[0].setButtonType(iconStateConstants.LEFT);
\r
9264 .directive('attSplitIconButtonGroup', ['$document', '$timeout', 'iconStateConstants' ,function($document,$timeout,iconStateConstants){
\r
9270 require: 'attSplitIconButtonGroup',
\r
9271 controller: 'AttSplitIconButtonGroupCtrl',
\r
9272 templateUrl: 'app/scripts/ng_js_att_tpls/splitIconButton/splitIconButtonGroup.html',
\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
9291 while(index < rightMostButtonIndex) {
\r
9292 subIconButtonCtrls[index].setButtonType(iconStateConstants.MIDDLE);
\r
9293 subIconButtonCtrls[index].isRightLineShown(false);
\r
9294 subIconButtonCtrls[index].isLeftLineShown(false);
\r
9297 var skipIndex = 2;
\r
9298 while(skipIndex <= rightMostButtonIndex){
\r
9299 if(skipIndex == rightMostButtonIndex) {
\r
9300 subIconButtonCtrls[skipIndex].isLeftLineShown(true);
\r
9302 subIconButtonCtrls[skipIndex].isRightLineShown(true);
\r
9303 subIconButtonCtrls[skipIndex].isLeftLineShown(true);
\r
9305 skipIndex = skipIndex + 2;
\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
9318 angular.element(ulElem).css('left','0px');
\r
9326 angular.module('att.abs.stepSlider', ['att.abs.position'])
\r
9327 .constant('sliderConstants', {
\r
9329 The MIT License (MIT)
\r
9330 Copyright (c) 2013 Julien Valéry
\r
9343 className: "jslider",
\r
9344 selector: ".jslider-"
\r
9350 BLUE_HIGHLIGHT: 'blue',
\r
9351 MAGENTA: 'magenta',
\r
9354 DARK_BLUE: 'dark-blue',
\r
9355 REGULAR: 'regular',
\r
9359 .factory('utils', function () {
\r
9361 The MIT License (MIT)
\r
9362 Copyright (c) 2013 Julien Valéry
\r
9365 offset: function (elm) {
\r
9366 var rawDom = elm[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
9376 roundUpToScale: function (mousePrc, scale, cutOffWidth, cutOffIndex) {
\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
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
9390 if ((lowerVal === 0 && mousePrc <= middle) || checkEquality(lowerVal, mousePrc)) {
\r
9391 newMousePrc = lowerVal;
\r
9394 else if (lowerVal < mousePrc && (mousePrc < higherVal ||
\r
9395 checkEquality(mousePrc, higherVal)))
\r
9397 newMousePrc = higherVal;
\r
9401 //Check if the newMousePrc is <= the cuttOffPoint
\r
9402 if (cutOffWidth && newMousePrc < cutOffWidth) {
\r
9403 return scale[cutOffIndex];
\r
9406 return newMousePrc;
\r
9409 Checks to see if 2 points are so close that they are
\r
9412 function checkEquality(point1, point2) {
\r
9413 var precision = 0.1;
\r
9414 if (Math.abs(point2 - point1) <= precision) {
\r
9420 valueForDifferentScale: function (from, to, prc, prcToValueMapper) {
\r
9421 var decimalPrc = prc / 100;
\r
9422 if (decimalPrc === 0) {
\r
9425 return prcToValueMapper[prc];
\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
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
9443 unitLabel = 'Kbps';
\r
9446 if (unitValue >= 1000000 && angular.equals(unitLabel, 'Kbps')) {
\r
9447 unitValue = truncator((unitValue/1000000), defaultDecimalPlaces);
\r
9448 unitLabel = 'Gbps';
\r
9451 unitValue: unitValue,
\r
9452 unitLabel: unitLabel
\r
9455 function truncator(numToTruncate, intDecimalPlaces) {
\r
9456 var cnvrtdNum = Math.pow(10, intDecimalPlaces);
\r
9457 return ~~(numToTruncate * cnvrtdNum)/cnvrtdNum;
\r
9460 getConversionFactorValue: function (value, conversion, firstDimension) {
\r
9462 Loop through the conversion array and keep checking the
\r
9465 if (value <= conversion[0].startVal) {
\r
9468 scaledDimension: firstDimension
\r
9472 for (var index in conversion) {
\r
9473 var c = conversion[index];
\r
9474 if (value > c.startVal) {
\r
9478 var scaleFactor = conversion[endIndex].scaleFactor;
\r
9479 var scaledVal = value / scaleFactor;
\r
9480 var scaledDimension = conversion[endIndex].dimension;
\r
9482 scaledVal: scaledVal,
\r
9483 scaledDimension: scaledDimension
\r
9488 .factory('sliderDraggable', ['utils', function (utils) {
\r
9490 The MIT License (MIT)
\r
9491 Copyright (c) 2013 Julien Valéry
\r
9493 function Draggable() {
\r
9494 this._init.apply(this, arguments);
\r
9496 Draggable.prototype.oninit = function () {
\r
9498 Draggable.prototype.events = function () {
\r
9500 Draggable.prototype.onmousedown = function () {
\r
9501 this.ptr.css({position: "absolute"});
\r
9503 Draggable.prototype.onmousemove = function (evt, x, y) {
\r
9504 this.ptr.css({left: x, top: y});
\r
9506 Draggable.prototype.onmouseup = function () {
\r
9508 Draggable.prototype.isDefault = {
\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
9522 angular.extend(this.is, this.isDefault);
\r
9523 var offset = utils.offset(this.ptr);
\r
9525 left: offset.left,
\r
9527 width: this.ptr[0].clientWidth,
\r
9528 height: this.ptr[0].clientHeight
\r
9530 this.oninit.apply(this, arguments);
\r
9534 Draggable.prototype._getPageCoords = function (event) {
\r
9536 if (event.targetTouches && event.targetTouches[0]) {
\r
9537 value = {x: event.targetTouches[0].pageX, y: event.targetTouches[0].pageY};
\r
9539 value = {x: event.pageX, y: event.pageY};
\r
9543 Draggable.prototype._bindEvent = function (ptr, eventType, handler) {
\r
9544 if (this.supportTouches_) {
\r
9545 ptr[0].attachEvent(this.events_[ eventType ], handler);
\r
9549 ptr.bind(this.events_[ eventType ], handler);
\r
9553 Draggable.prototype._events = function () {
\r
9555 this.supportTouches_ = 'ontouchend' in document;
\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
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
9573 this._bindEvent(documentElt, "down", function (event) {
\r
9574 if (self.is.drag) {
\r
9575 event.stopPropagation();
\r
9576 event.preventDefault();
\r
9579 this._bindEvent(documentElt, "up", function (event) {
\r
9580 self._mouseup(event);
\r
9582 this._bindEvent(this.ptr, "down", function (event) {
\r
9583 self._mousedown(event);
\r
9586 this._bindEvent(this.ptr, "up", function (event) {
\r
9587 self._mouseup(event);
\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
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
9607 this.onmousedown(evt);
\r
9609 Draggable.prototype._mousemove = function (evt) {
\r
9610 if (this.uid === 0) {
\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
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
9624 this.outer.css({overflow: "visible"});
\r
9626 if ($.browser.msie && $.browser.version === '6.0') {
\r
9627 this.outer.css({height: "100%"});
\r
9629 this.outer.css({height: "auto"});
\r
9632 this.onmouseup(evt);
\r
9637 .factory('sliderPointer', ['sliderDraggable', 'utils', function (Draggable, utils) {
\r
9639 The MIT License (MIT)
\r
9640 Copyright (c) 2013 Julien Valéry
\r
9642 function SliderPointer() {
\r
9643 Draggable.apply(this, arguments);
\r
9645 SliderPointer.prototype = new Draggable();
\r
9646 SliderPointer.prototype.oninit = function (ptr, id, _constructor) {
\r
9648 this.parent = _constructor;
\r
9650 this.settings = angular.copy(_constructor.settings);
\r
9652 SliderPointer.prototype.onmousedown = function (evt) {
\r
9653 var off = utils.offset(this.parent.domNode);
\r
9657 width: this.parent.domNode[0].clientWidth,
\r
9658 height: this.parent.domNode[0].clientHeight
\r
9662 width: offset.width,
\r
9663 height: offset.height
\r
9665 this.ptr.addClass("jslider-pointer-hover");
\r
9666 this.setIndexOver();
\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
9678 var cutOffWidth = this.parent.settings.cutOffWidth;
\r
9679 if (cutOffWidth && val < cutOffWidth) {
\r
9680 val = cutOffWidth;
\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
9689 this.ptr.removeClass("jslider-pointer-hover");
\r
9691 SliderPointer.prototype.setIndexOver = function () {
\r
9692 this.parent.setPointersIndex(1);
\r
9695 SliderPointer.prototype.index = function (i) {
\r
9697 SliderPointer.prototype.limits = function (x) {
\r
9698 return this.parent.limits(x, this);
\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
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
9709 SliderPointer.prototype._set = function (prc, opt_origin) {
\r
9710 if (!opt_origin) {
\r
9711 this.value.origin = this.parent.prcToValue(prc);
\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
9718 return SliderPointer;
\r
9720 .factory('slider', ['sliderPointer', 'sliderConstants', 'utils', function (SliderPointer, sliderConstants, utils) {
\r
9722 The MIT License (MIT)
\r
9723 Copyright (c) 2013 Julien Valéry
\r
9726 function Slider() {
\r
9727 return this.init.apply(this, arguments);
\r
9729 function changeCutOffWidth(width) {
\r
9730 cutOffDom.css('width', width);
\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
9743 if (this.settings.onstatechange && $.isFunction(this.settings.onstatechange)) {
\r
9744 this.onstatechange = this.settings.onstatechange;
\r
9746 this.is = {init: false};
\r
9748 this.create(templateNode);
\r
9750 Slider.prototype.create = function (templateNode) {
\r
9752 this.domNode = templateNode;
\r
9753 var off = utils.offset(this.domNode);
\r
9757 width: this.domNode[0].clientWidth,
\r
9758 height: this.domNode[0].clientHeight
\r
9760 this.sizes = {domWidth: this.domNode[0].clientWidth, domOffset: offset};
\r
9761 angular.extend(this.o, {
\r
9765 o: angular.element(this.domNode.find('div')[5])
\r
9768 o: angular.element(this.domNode.find('div')[6])
\r
9772 0: angular.element(this.domNode.find('div')[3]),
\r
9773 1: angular.element(this.domNode.find('div')[5])
\r
9776 angular.extend(this.o.labels[0], {
\r
9777 value: this.o.labels[0].o.find("span")
\r
9779 angular.extend(this.o.labels[1], {
\r
9780 value: this.o.labels[1].o.find("span")
\r
9782 if (!$this.settings.value.split(";")[1]) {
\r
9783 this.settings.single = true;
\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
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
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
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
9804 $this.domNode.bind('mousedown', $this.clickHandler.apply($this));
\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
9814 Slider.prototype.clickHandler = function () {
\r
9816 return function (evt) {
\r
9817 if (self.disabled) {
\r
9820 var className = evt.target.className;
\r
9821 var targetIdx = 0;
\r
9822 if (className.indexOf('jslider-pointer-to') > 0) {
\r
9825 var _off = utils.offset(self.domNode);
\r
9829 width: self.domNode[0].clientWidth,
\r
9830 height: self.domNode[0].clientHeight
\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
9840 Slider.prototype.disable = function (bool) {
\r
9841 this.disabled = bool;
\r
9843 Slider.prototype.nice = function (value) {
\r
9846 Slider.prototype.onstatechange = function () {
\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
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
9857 if (another && !pointer.uid && x > another.value.prc) {
\r
9858 x = another.value.prc;
\r
9866 var val = Math.round(x * 10) / 10;
\r
9869 Slider.prototype.setPointersIndex = function (i) {
\r
9870 angular.forEach(this.getPointers(), function (pointer, i) {
\r
9874 Slider.prototype.getPointers = function () {
\r
9875 return this.o.pointers;
\r
9877 Slider.prototype.onresize = function () {
\r
9880 domWidth: this.domNode[0].clientWidth,
\r
9881 domHeight: this.domNode[0].clientHeight,
\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
9889 angular.forEach(this.o.pointers, function (ptr, key) {
\r
9893 Slider.prototype.update = function () {
\r
9897 Slider.prototype.drawScale = function () {
\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
9909 if (!this.is.init) {
\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
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
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
9936 htmlValue = parseFloat(htmlValue);
\r
9937 var tooltipLabel = utils.convertToMbpsGbps(htmlValue, scaledDimension, this.settings.decimalPlaces);
\r
9939 this.o.labels[pointer.uid].value.html(tooltipLabel.unitValue + ' ' + tooltipLabel.unitLabel);
\r
9940 //Top tooltip label
\r
9941 this.redrawLabels(pointer);
\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
9951 if (sizes.border + sizes.label / 2 > domSize) {
\r
9953 sizes.right = true;
\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
9960 label.o.css({left: "auto", right: 0});
\r
9964 var label = this.o.labels[pointer.uid];
\r
9965 var prc = pointer.value.prc;
\r
9967 label: label.o[0].offsetWidth,
\r
9969 border: (prc * domSize) / 100
\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
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) + " – " + this.nice(another.value.origin));
\r
9985 sizes.label = label.o[0].clientWidth;
\r
9986 sizes.border = (prc * domSize) / 100;
\r
9989 another_label.o.css({visibility: "visible"});
\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) + " – " + this.nice(pointer.value.origin));
\r
10000 sizes.label = label.o[0].clientWidth;
\r
10001 sizes.border = (prc * domSize) / 100;
\r
10004 another_label.o.css({visibility: "visible"});
\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
10014 label: another_label.o[0].clientWidth,
\r
10016 border: (another.value.prc * this.sizes.domWidth) / 100
\r
10018 sizes = setPosition(another_label, sizes, another.value.prc);
\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
10037 for (var i = 0; i < limits.length; i++) {
\r
10039 angular.element(this.o.limits[i]).addClass("animate-show");}
\r
10041 angular.element(this.o.limits[i]).addClass("animate-hidde");}
\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
10050 Slider.prototype.getValue = function () {
\r
10051 if (!this.is.init){
\r
10053 var $this = this;
\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
10063 $this.settings.prcToValueMapper);
\r
10065 value += (key > 0 ? ";" : "") + myValue;
\r
10070 Slider.prototype.getPrcValue = function () {
\r
10071 if (!this.is.init)
\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
10080 Slider.prototype.prcToValue = function (prc) {
\r
10082 if (this.settings.heterogeneity && this.settings.heterogeneity.length > 0) {
\r
10083 var h = this.settings.heterogeneity;
\r
10085 var _from = this.settings.from;
\r
10086 for (var i = 0; i <= h.length; i++) {
\r
10089 v = h[i].split("/");}
\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
10100 value = this.settings.from + (prc * this.settings.interval) / 100;
\r
10102 var roundedValue = this.round(value);
\r
10103 return roundedValue;
\r
10105 Slider.prototype.valueToPrc = function (value, pointer) {
\r
10107 if (this.settings.heterogeneity && this.settings.heterogeneity.length > 0) {
\r
10108 var h = this.settings.heterogeneity;
\r
10110 var _from = this.settings.from;
\r
10111 for (var i = 0; i <= h.length; i++) {
\r
10114 v = h[i].split("/");
\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
10124 prc = pointer.limits((value - this.settings.from) * 100 / this.settings.interval);
\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
10133 value = Math.round(value);}
\r
10138 .directive('attStepSlider', [
\r
10139 '$compile', '$templateCache', '$timeout', '$window', 'slider', 'sliderConstants', 'utils',
\r
10140 function (compile, templateCache, timeout, win, Slider, sliderConstants, utils) {
\r
10142 The MIT License (MIT)
\r
10143 Copyright (c) 2013 Julien Valéry
\r
10145 var templateUrl = 'app/scripts/ng_js_att_tpls/stepSlider/attStepSlider.html';
\r
10148 require: '?ngModel',
\r
10154 templateUrl: templateUrl,
\r
10155 link: function (scope, element, attrs, ngModel) {
\r
10158 scope.mainSliderClass = 'step-slider';
\r
10159 element.after(compile(templateCache.get(templateUrl))(scope, function (clonedElement, scope) {
\r
10160 scope.tmplElt = clonedElement;
\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
10168 if (!ngModel.$viewValue && ngModel.$viewValue !== 0) {
\r
10171 if (typeof (ngModel.$viewValue) === 'number') {
\r
10172 ngModel.$viewValue = '' + ngModel.$viewValue;
\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
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
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
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
10211 function addScaleArrayStartAndEnd() {
\r
10212 if (scaleArray[0] !== 0) {
\r
10213 scaleArray.splice(0, 0, 0);
\r
10215 if (scaleArray[scaleArray.length - 1] !== 100) {
\r
10216 scaleArray.splice(scaleArray.length, 0, 100);
\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
10224 if(scope.options.displayScaledvalues){
\r
10225 for(var i in scaleArray){
\r
10226 scaledUpValueArray.push(Math.log2(scaleArray[i]));
\r
10228 var maxScaledUpValue=scaledUpValueArray[scaledUpValueArray.length-1];
\r
10231 for (var i in scaleArray) {
\r
10233 var fromValueCheck = (scaleArray[i] / scope.options.from);
\r
10234 var toValueCheck = (scaleArray[i] / scope.options.to);
\r
10236 if (scope.options.displayScaledvalues){
\r
10237 prcValue = (scaledUpValueArray[i] /maxScaledUpValue)*100;
\r
10239 prcValue = ((scaleArray[i] - scope.options.from) / (scope.options.to - scope.options.from)) * 100;
\r
10242 var realValue = scaleArray[i];
\r
10244 if (toValueCheck === 1) {
\r
10247 else if (fromValueCheck === 1) {
\r
10250 scaleArray[i] = prcValue;
\r
10251 prcToValueMapper['' + prcValue] = realValue;
\r
10254 if ((scope.options.from !== 0 || scope.options.to !== 100)
\r
10255 && scope.options.smooth) {
\r
10257 scale array is in real values.
\r
10259 addScaleArrayStartAndEnd();
\r
10260 scope.options.stepWithDifferentScale = true;
\r
10262 else if ((scope.options.from !== 0 || scope.options.to !== 100)
\r
10263 && !scope.options.smooth) {
\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
10268 scope.options.stepWithDifferentScale = true;
\r
10269 convertScaleArrayToPercentage();
\r
10270 addScaleArrayStartAndEnd();
\r
10274 This is the normal case where the from and to values are 0 and
\r
10275 100 respectively.
\r
10277 //Check that the scale starts at 0 and 100
\r
10278 convertScaleArrayToPercentage();
\r
10279 addScaleArrayStartAndEnd();
\r
10281 var decimalPlaces = 0;
\r
10282 if (scope.options.decimalPlaces) {
\r
10283 decimalPlaces = scope.options.decimalPlaces;
\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
10295 var toVal = (scope.to / lastScaleFactor).toFixed(decimalPlaces);
\r
10296 scope.toStr = toVal;
\r
10298 scope.toStr = scope.options.to;
\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
10306 from: scope.options.from,
\r
10307 to: scope.options.to,
\r
10308 step: scope.options.step,
\r
10309 smooth: scope.options.smooth,
\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
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
10329 OPTIONS.callback = forceApply;
\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
10339 scope.slider = angular.element.slider(element, scope.tmplElt, OPTIONS);
\r
10340 angular.element(scaleDiv).html(scope.generateScale());
\r
10341 scope.drawScale(scaleDiv);
\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
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
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
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
10378 scope.slider.settings.cutOffVal = 0;
\r
10383 function initListener() {
\r
10384 angular.element(win).bind('resize', function (event) {
\r
10385 scope.slider.onresize();
\r
10388 scope.generateScale = function () {
\r
10389 if (scope.options.scale && scope.options.scale.length > 0) {
\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
10399 str += '<span style="' + position + ': ' + scaledPosition + '%"></span>';
\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
10412 var forceApply = function (value) {
\r
10413 var val = value.split(";")[1];
\r
10414 scope.$apply(function () {
\r
10415 ngModel.$setViewValue(parseInt(val));
\r
10417 if (scope.options.callback) {
\r
10418 scope.options.callback(parseInt(val));
\r
10421 scope.$watch('options', function (value) {
\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
10433 angular.module('att.abs.steptracker', ['att.abs.transition'])
\r
10434 .directive('steptracker', ['$timeout', function ($timeout) {
\r
10436 // This allows dev's clickHandler to cancel an operation
\r
10440 cstep: "=currentStep",
\r
10441 clickHandler: '=?',
\r
10442 disableClick: '=?'
\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
10451 $timeout(function () {
\r
10452 if (scope.cstep < 1) {
\r
10455 else if (scope.cstep > scope.sdata.length) {
\r
10456 scope.cstep = scope.sdata.length;
\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
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
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
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
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
10494 scope.$watch('sdata', function () {
\r
10496 var prevStep = scope.cstep;
\r
10497 // Before anything, ensure currentPage is never below 1
\r
10498 if (currentPage < 1) {
\r
10500 if (scope.cstep !== 1) {
\r
10501 // Decrease step, current track width is 0%, new step width updates
\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
10512 currentPage = totalPage;
\r
10513 updateTrackWidth();
\r
10516 updateTrackWidth();
\r
10519 if (currentPage < 1 && prevStep === scope.cstep) {
\r
10521 if (scope.cstep > 1) {
\r
10523 scope.sdata[scope.cstep - 1]['currentPage'] = scope.sdata[scope.cstep - 1]['totalPages'];
\r
10524 scope.sdata[scope.cstep]['currentPage'] = 1;
\r
10527 updateTrackWidth();
\r
10529 //add the active class for current step
\r
10530 scope.activestep = function (index) {
\r
10531 return (index === scope.cstep - 1);
\r
10533 //add the done class for finished step
\r
10534 scope.donesteps = function (index) {
\r
10535 return (index < scope.cstep - 1);
\r
10537 //add the last class for final step
\r
10538 scope.laststep = function (index) {
\r
10539 return (index === scope.sdata.length - 1);
\r
10541 scope.isIncomplete = function (index) {
\r
10542 if (index === scope.cstep - 1) {
\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
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
10557 scope.sdata[steps]['currentPage']--;
\r
10559 if (angular.isFunction(scope.clickHandler)) {
\r
10560 scope.clickHandler($event, steps);
\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
10568 updateTrackWidth();
\r
10575 .constant('timelineConstants', {
\r
10578 COMPLETED: 'completed',
\r
10579 CANCELLED: 'cancelled'
\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
10589 this.addTimelineBarCtrls = function (t) {
\r
10590 timelineBarCtrls.push(t);
\r
10592 this.addTimelineDotCtrls = function (b) {
\r
10593 timelineDotCtrls.push(b);
\r
10595 $timeout(init, 200);
\r
10596 function init() {
\r
10597 function compare(a, b) {
\r
10598 if (a.order < b.order) {
\r
10601 if (a.order > b.order) {
\r
10606 timelineDotCtrls.sort(compare);
\r
10607 timelineBarCtrls.sort(compare);
\r
10608 if ($scope.$parent.animate) {
\r
10609 animateSequence();
\r
10611 $scope.$watch('trigger', function (val) {
\r
10613 $scope.resetTimeline();
\r
10615 $scope.$parent.animate = false;
\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
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
10632 dotCtrl.unhoveredStateForAbove(.25);
\r
10634 if (dotCtrl.isStop()) {
\r
10639 function createAnimation(i, duration) {
\r
10641 return function () {
\r
10642 if (timelineDotCtrls[i + 1].isStop() && timelineDotCtrls[i + 1].isCancelled()) {
\r
10643 timelineBarCtrls[i].isCancelled(true);
\r
10645 timelineBarCtrls[i].animate(createAnimation(i + 1, duration), duration);
\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
10653 if (timelineDotCtrls[i].isStop()) {
\r
10654 timelineDotCtrls[i - 1].shrinkAnimate(dotsDuration);
\r
10655 timelineDotCtrls[i].isCurrentStep(true);
\r
10657 timelineDotCtrls[i - 1].shrinkAnimate(dotsDuration);
\r
10658 timelineBarCtrls[i].animate(createAnimation(i + 1, duration), duration);
\r
10660 timelineDotCtrls[i].expandedAnimate(dotsDuration);
\r
10661 $timeout(function () {
\r
10662 setToInactiveStates();
\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
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
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
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
10695 if (timelineDotCtrls[i + 1].isStop() && timelineDotCtrls[i + 1].isCancelled()) {
\r
10696 timelineBarCtrls[i].isCancelled(true);
\r
10698 timelineDotCtrls[i - 1].shrinkAnimate(dotsDuration);
\r
10699 timelineBarCtrls[i].animate(createAnimation(i + 1, duration), duration);
\r
10700 timelineDotCtrls[i].expandedAnimate(dotsDuration);
\r
10708 .directive('attTimeline', ['$timeout', '$compile', function ($timeout, $compile) {
\r
10716 barAnimateDuration: '='
\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
10728 scope.middleSteps = middleSteps;
\r
10729 //Used in calculating the width of the loading bars
\r
10730 ctrl.numSteps = steps.length - 1;
\r
10733 //Recompile in case of scope changes
\r
10734 scope.resetTimeline = function () {
\r
10735 scope.animate = true;
\r
10736 $compile(element)(scope);
\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
10747 this.isCancelled = function (isCancelled) {
\r
10748 $scope.isCancelled = isCancelled;
\r
10751 .directive('timelineBar', ['animation', '$progressBar', function (animation, $progressBar) {
\r
10755 templateUrl: 'app/scripts/ng_js_att_tpls/steptracker/timelineBar.html',
\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
10777 scope.loadingAnimation = $progressBar(updateCallback);
\r
10781 .controller('TimelineDotCtrl', ['$scope', '$timeout', 'timelineConstants', function ($scope, $timeout, timelineConstants) {
\r
10782 this.type = 'dot';
\r
10783 this.order = parseInt($scope.order);
\r
10785 $timeout(function () {
\r
10786 if (self.order !== 0) {
\r
10787 if (self.order % 2 !== 0) {
\r
10788 $scope.initializeAboveForAnimation();
\r
10791 $scope.initializeBelowForAnimation();
\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
10802 $scope.expandContentForBelow(duration);
\r
10806 this.unhoveredStateForAbove = function (duration) {
\r
10807 $scope.unhoveredStateForAbove(duration);
\r
10809 this.unhoveredStateForBelow = function (duration) {
\r
10810 $scope.unhoveredStateForBelow(duration);
\r
10812 this.shrinkAnimate = function (duration) {
\r
10813 $scope.shrinkAnimate(duration);
\r
10815 this.setExpanded = function () {
\r
10816 $scope.setSize(3);
\r
10818 this.isStop = function () {
\r
10819 return $scope.isStop;
\r
10821 this.isCancelled = function () {
\r
10822 return ($scope.type === timelineConstants.STEP_TYPE.CANCELLED);
\r
10824 this.isAlert = function () {
\r
10825 return ($scope.type === timelineConstants.STEP_TYPE.ALERT);
\r
10827 //Sets the bolded text
\r
10828 this.isCurrentStep = function (isCurrentStep) {
\r
10829 if (isCurrentStep !== undefined) {
\r
10830 $scope.isCurrentStep = isCurrentStep;
\r
10832 return $scope.isCurrentStep;
\r
10835 .directive('timelineDot', ['animation', 'timelineConstants',
\r
10836 function (animation, timelineConstants) {
\r
10843 description: '@',
\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
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
10876 scope.isStepsLessThanFive = function () {
\r
10877 if (scope.numSteps < 5) {
\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
10887 if (num === 2 && scope.order % 2 !== 0) {
\r
10888 scope.expandContentForAbove(.25);
\r
10892 scope.titleMouseleave = function () {
\r
10893 if (scope.order % 2 === 0) {
\r
10894 scope.unhoveredStateForBelow(.25);
\r
10897 scope.unhoveredStateForAbove(.25);
\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
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
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
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
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
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
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
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
10953 scope.isBelowInfoBoxShown = false;
\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
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
10972 scope.setColor = function () {
\r
10973 scope.isInactive = false;
\r
10974 if (scope.type === timelineConstants.STEP_TYPE.CANCELLED) {
\r
10975 scope.isCancelled = true;
\r
10977 else if (scope.type === timelineConstants.STEP_TYPE.ALERT) {
\r
10978 scope.isAlert = true;
\r
10981 scope.isCompleted = true;
\r
10983 if (!scope.$phase) {
\r
10987 scope.setSize = function (size) {
\r
10988 animation.set(biggerCircle, {scale: size});
\r
10990 scope.setExpandedCircle = function () {
\r
10991 animation.set(expandableCircleElem, {opacity: '1.0'});
\r
10992 animation.set(expandableCircleElem, {scale: 1});
\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
10999 scope.shrinkAnimate = function (duration) {
\r
11000 animation.to(biggerCircleElem, duration, {scale: 1});
\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
11012 .directive('attTable', ['$filter', function($filter) {
\r
11016 transclude: true,
\r
11019 viewPerPage: "=",
\r
11020 currentPage: "=",
\r
11022 searchCategory: "=",
\r
11023 searchString: "="
\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
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
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
11048 this.getSearchString = function() {
\r
11049 return $scope.searchString;
\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
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
11067 scope.$watch('currentPage', function(val) {
\r
11068 scope.$parent.currentPage = val;
\r
11070 scope.$watch('viewPerPage', function(val) {
\r
11071 scope.$parent.viewPerPage = val;
\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
11081 var searchValCheck = function(val){
\r
11082 if(angular.isDefined(val) && val !== null && val !== ""){
\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
11093 }else if(searchValCheck(v1) && (!angular.isDefined(v2) || v2 === null || v2 === "")){
\r
11094 scope.searchCriteria = {
\r
11098 scope.searchCriteria = {};
\r
11101 scope.$watch('searchCategory', function(newVal,oldVal) {
\r
11102 if(newVal !== oldVal){
\r
11103 setSearchCriteria(scope.searchString,newVal);
\r
11106 scope.$watch('searchString', function (newVal,oldVal) {
\r
11107 if(newVal !== oldVal){
\r
11108 setSearchCriteria(newVal,scope.searchCategory);
\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
11120 .directive('attTableRow', [function() {
\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
11132 html.attr('ng-repeat', attr.rowRepeat.concat(" | orderBy : columnIndex : reverse | filter : searchCriteria : false | attLimitTo : viewPerPage : viewPerPage*(currentPage-1) track by $index"));
\r
11135 html.attr('ng-class', "{'alt-row': $even,'normal-row': $odd}");
\r
11136 elem.append(html);
\r
11142 .directive('attTableHeader', ['tableConfig', function(tableConfig) {
\r
11146 transclude: true,
\r
11149 defaultSort: '@',
\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
11160 scope.$watch(function() {
\r
11161 return elem.text();
\r
11162 }, function(value) {
\r
11163 scope.headerName = value;
\r
11165 scope.sort = function(sortType) {
\r
11166 if(typeof sortType === 'boolean') {
\r
11167 reverse = sortType;
\r
11169 ctrl.sortData(scope.index, reverse);
\r
11170 scope.sortPattern = reverse ? 'descending' : 'ascending';
\r
11171 reverse = !reverse;
\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
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
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
11194 scope.resetSortPattern = function() {
\r
11195 reverse = tableConfig.defaultSortPattern;
\r
11201 .directive('attTableBody', ['$filter', '$timeout', 'tableConfig', function($filter, $timeout, tableConfig) {
\r
11204 require: '^attTable',
\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
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
11222 wrapElement(elem);
\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
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
11242 if (actualHtml.length > 0) {
\r
11245 wrapElement(elem);
\r
11253 angular.module('att.abs.tableMessages', ['att.abs.utilities'])
\r
11254 .constant('messageConstants', {
\r
11255 TABLE_MESSAGE_TYPES: {
\r
11258 magnifySearch: 3,
\r
11260 USER_MESSAGE_TYPES: {
\r
11265 .directive('attTableMessage', ['messageConstants', function(messageConstants) {
\r
11269 transclude: true,
\r
11272 onRefreshClick: '&'
\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
11282 }]).directive('attUserMessage', ['messageConstants', '$timeout', 'DOMHelper', function(messageConstants, $timeout, DOMHelper) {
\r
11286 transclude: true,
\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
11299 $timeout(function() {
\r
11300 firstElement = DOMHelper.firstTabableElement(element[0]);
\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
11311 if (angular.isDefined(prevActiveElement)) {
\r
11312 prevActiveElement.focus();
\r
11321 angular.module('att.abs.tabs', ['att.abs.utilities'])
\r
11322 .directive('attTabs', function () {
\r
11325 transclude: false,
\r
11330 controller: ['$scope', function ($scope) {
\r
11331 this.getData = function () {
\r
11332 return $scope.tabs;
\r
11334 this.onClickTab = function (tab) {
\r
11335 $scope.currentTab = tab.url;
\r
11336 return $scope.currentTab;
\r
11338 this.isActiveTab = function (tab) {
\r
11339 return (tab === $scope.currentTab);
\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
11351 .directive('floatingTabs', function () {
\r
11353 require: '^attTabs',
\r
11355 transclude: false,
\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
11368 .directive('simplifiedTabs', function () {
\r
11370 require: '^attTabs',
\r
11372 transclude: false,
\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
11384 scope.isActive = function (tab) {
\r
11385 return (tab === scope.ctab);
\r
11390 .directive('genericTabs', function () {
\r
11392 require: '^attTabs',
\r
11394 transclude: false,
\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
11406 scope.isActive = function (tab) {
\r
11407 return (tab === scope.ctab);
\r
11412 .directive('skipNavigation', function(){
\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
11424 .directive('parentTab', [function () {
\r
11429 activeSubMenu: '=',
\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
11444 this.setSubMenuStatus(false);
\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
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
11463 $scope.menuItems=$scope.megaMenu;
\r
11467 var checkSubMenuStatus = false;
\r
11468 this.setSubMenuStatus = function (value) {
\r
11469 checkSubMenuStatus = value;
\r
11471 this.getSubMenuStatus = function () {
\r
11472 return checkSubMenuStatus;
\r
11474 this.setActiveMenuTab = function (tab) {
\r
11475 $scope.megaMenuTab = tab;
\r
11477 this.setActiveMenuHoverTab = function (tab) {
\r
11478 $scope.megaMenuHoverTab = tab;
\r
11480 this.setActiveSubMenuTab = function () {
\r
11481 $scope.megaMenuTab = $scope.megaMenuHoverTab;
\r
11483 this.resetMenuTab = function () {
\r
11484 $scope.megaMenuTab = undefined;
\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
11496 .directive('parentmenuTabs', [function () {
\r
11499 transclude: true,
\r
11505 controller: ['$scope', function ($scope) {
\r
11506 this.getMenu = function () {
\r
11507 return $scope.menuItems;
\r
11509 this.setMenu = function (menuItem) {
\r
11510 $scope.menuItems = menuItem;
\r
11513 templateUrl: 'app/scripts/ng_js_att_tpls/tabs/parentmenuTab.html'
\r
11517 .directive('menuTabs', ["$window", "$document",'events','keymap', function (win, $document, events, keymap) {
\r
11520 transclude: true,
\r
11522 require: ['^?parentTab', '^?parentmenuTabs'],
\r
11527 subItemActive: "@",
\r
11531 templateUrl: function (element, attrs) {
\r
11532 if (attrs.megaMenu) {
\r
11533 return 'app/scripts/ng_js_att_tpls/tabs/menuTab.html';
\r
11536 return 'app/scripts/ng_js_att_tpls/tabs/submenuTab.html';
\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
11548 //scope.showChildren(e);
\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
11561 scope.clickInactive = true;
\r
11563 scope.menuItem.active = true;
\r
11564 scope.activeMenu = scope.menuItem;
\r
11565 e.stopPropagation();
\r
11567 scope.$watch("subItemActive", function (value) {
\r
11568 if (value === "true" && scope.subMenu === 'true') {
\r
11569 parentCtrl.setActiveMenuHoverTab(scope.menuItem);
\r
11572 scope.showMenuClick = function (e) {
\r
11573 parentCtrl.setActiveMenuTab(scope.menuItem);
\r
11574 e.stopPropagation();
\r
11576 scope.showSubMenuClick = function (e) {
\r
11577 parentCtrl.setActiveSubMenuTab();
\r
11578 e.stopPropagation();
\r
11580 scope.resetMenu = function (e) {
\r
11581 parentCtrl.resetMenuTab();
\r
11582 e.stopPropagation();
\r
11584 function debounce(method, delay) {
\r
11585 clearTimeout(method._tId);
\r
11586 method._tId = setTimeout(function () {
\r
11587 parentCtrl.setMenu();
\r
11590 function debounce1(method, delay) {
\r
11591 clearTimeout(method._tId);
\r
11592 method._tId = setTimeout(function () {
\r
11593 parentCtrl.setActiveMenu();
\r
11596 $document.bind('scroll', function () {
\r
11597 /* if (win.pageYOffset === 0) {
\r
11598 debounce(parentCtrl.setMenu, 100);
\r
11600 else if (win.pageYOffset > 1 && win.pageYOffset < 1500) {
\r
11601 debounce1(parentCtrl.setActiveMenu, 100);
\r
11604 elem.bind('keydown', function(evt){
\r
11605 if (!(evt.keyCode)){
\r
11606 evt.keyCode = evt.which;
\r
11608 if(evt.keyCode !== keymap.KEY.TAB){
\r
11609 events.preventDefault(evt);
\r
11610 events.stopPropagation(evt);
\r
11613 switch (evt.keyCode) {
\r
11614 case keymap.KEY.ESC:
\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
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
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
11632 if (elem.attr("menu-item") === "item") {
\r
11633 /* Works when user on Mega menu*/
\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
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
11652 if (el && el.nextSibling){
\r
11653 el = el.nextSibling;
\r
11658 } while (el && el.tagName !== 'LI');
\r
11660 if (el.querySelector("a") == null){}
\r
11662 el.querySelector("a").focus();}
\r
11664 events.preventDefault(evt);
\r
11665 events.stopPropagation(evt);
\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
11675 if (el && el.nextSibling){
\r
11676 el = el.nextSibling;
\r
11681 } while (el && el.tagName !== 'LI');
\r
11683 if (el.querySelector("a") == null){}
\r
11685 el.querySelector("a").focus();}
\r
11693 if (elem.attr("menu-item") === "item") {
\r
11694 /* When user navigates through on Mega menu*/
\r
11696 var el = angular.element(elem)[0];
\r
11698 if(el.nextElementSibling){
\r
11699 if(el.nextElementSibling.querySelector("span") == null){
\r
11702 el.nextElementSibling.querySelector("span").focus();
\r
11707 if (el && el.nextSibling){
\r
11708 el = el.nextSibling;
\r
11713 } while (el && el.tagName !== 'LI');
\r
11715 if(el.querySelector("span") === null){}
\r
11717 el.querySelector("span").focus();
\r
11720 events.preventDefault(evt);
\r
11721 events.stopPropagation(evt);
\r
11726 case keymap.KEY.DOWN:
\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
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
11741 if (el && el.nextSibling){
\r
11742 el = el.nextSibling;
\r
11747 } while (el && el.tagName !== 'A');
\r
11748 if(el.attributes !== null){
\r
11751 events.stopPropagation(evt);
\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
11763 case keymap.KEY.LEFT:
\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
11775 if (el && el.previousSibling){
\r
11776 el = el.previousSibling;
\r
11781 } while (el && el.tagName !== 'LI');
\r
11783 if (el.querySelector("a") == null){}
\r
11785 el.querySelector("a").focus();}
\r
11787 events.preventDefault(evt);
\r
11788 events.stopPropagation(evt);
\r
11791 /*el.previousElementSibling.querySelector("span").focus();
\r
11792 events.stopPropagation(evt);
\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
11802 if (el && el.previousSibling){
\r
11803 el = el.previousSibling;
\r
11808 } while (el && el.tagName !== 'LI');
\r
11810 if (el.querySelector("a") == null){}
\r
11812 el.querySelector("a").focus();}
\r
11819 if (elem.attr("menu-item") === "item") {
\r
11820 /* Works when user on Mega menu*/
\r
11822 var el = angular.element(elem)[0];
\r
11823 if(el.previousElementSibling){
\r
11825 if(el.previousElementSibling.querySelector("span") === null){
\r
11828 el.previousElementSibling.querySelector("span").focus();
\r
11834 if (el && el.previousSibling){
\r
11835 el = el.previousSibling;
\r
11840 } while (el && el.tagName !== 'LI');
\r
11842 if (el.querySelector("span") === null) {
\r
11845 el.querySelector("span").focus();
\r
11848 events.preventDefault(evt);
\r
11849 events.stopPropagation(evt);
\r
11854 case keymap.KEY.UP:
\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
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
11873 if(el.previousElementSibling) {
\r
11874 var prev_a = el.previousElementSibling;
\r
11875 (el.previousElementSibling != null)? el.previousElementSibling.focus(): parent_menu.focus();
\r
11878 if (el && el.previousSibling){
\r
11879 el = el.previousSibling;
\r
11884 } while (el && el.tagName !== 'A');
\r
11885 if(el && (el.nodeType !== 3)){
\r
11888 events.preventDefault(evt);
\r
11889 events.stopPropagation(evt);
\r
11902 angular.module('att.abs.tagBadges', [])
\r
11903 .directive('tagBadges', ['$parse', '$timeout', function($parse, $timeout) {
\r
11907 transclude: true,
\r
11908 templateUrl: 'app/scripts/ng_js_att_tpls/tagBadges/tagBadges.html',
\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
11922 if (attr.small === "") {
\r
11923 scope.isSmall = true;
\r
11925 if (scope.styleType === "icon") {
\r
11926 scope.isIcon = true;
\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
11939 scope.activeHighlight = function(state){
\r
11940 if(scope.customColor){
\r
11942 scope.isHighlight = true;
\r
11945 scope.isHighlight = false;
\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
11956 elem.bind('blur', function(){
\r
11960 if(attr['onClose']){
\r
11961 scope.onClose = $parse(scope.onClose);
\r
11969 angular.module('att.abs.textOverflow', [])
\r
11970 .constant('textDefaultOptions', {
\r
11973 .directive('attTextOverflow', ['textDefaultOptions','$compile',function(textDefaultOptions,$compile)
\r
11977 link: function(scope, elem, attrs)
\r
11979 var tooltipText = elem.text();
\r
11980 elem.addClass('text-ellipsis');
\r
11981 attrs.$observe('attTextOverflow', function(val){
\r
11983 elem.css({"width":val});
\r
11986 elem.css({"width":textDefaultOptions.width});
\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
11999 angular.module('att.abs.toggle', ['angular-gestures', 'att.abs.position'])
\r
12000 .directive('attToggleTemplate', ['$compile', '$log', '$position', function ($compile, $log, $position)
\r
12004 require: 'ngModel',
\r
12005 transclude: true,
\r
12007 modelVal: "=ngModel"
\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
12017 scope.modelVal = false;
\r
12021 scope.modelVal = true;
\r
12024 scope.updateModel = function (env) {
\r
12026 if (dragStatus !== 1) {
\r
12027 updateModelVal();
\r
12031 env.preventDefault();
\r
12033 scope.drag = function (e) {
\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
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
12050 if (isOn || (!isOn && e.gesture.direction === "left")) {
\r
12051 updateModelVal();
\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
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
12074 element.children().eq(1).css({
\r
12075 left: switchMovementPathPixels
\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
12082 element.children().eq(1).css({
\r
12091 .directive('attToggleMain', ['$compile', function ($compile)
\r
12095 require: 'ngModel',
\r
12096 transclude: true,
\r
12099 modelValue: "=ngModel",
\r
12100 trueValue: "=ngTrueValue",
\r
12101 falseValue: "=ngFalseValue"
\r
12103 link: function (scope, element, attr) {
\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
12113 if (scope.largeValue !== undefined)
\r
12115 attrVal += ' ="{{largeValue}}"';
\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
12125 angular.module('att.abs.treeview', [])
\r
12126 .directive('treeView', function() {
\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
12142 function toggleTree(e) {
\r
12143 e.stopPropagation();
\r
12144 if (angular.element(e.target).attr("tree-view") !== undefined)
\r
12146 if (elem.hasClass('minus'))
\r
12148 elem.removeClass('minus');
\r
12152 elem.addClass('minus');
\r
12157 elem.on('click', function(e) {
\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
12165 e.preventDefault();
\r
12172 angular.module('att.abs.typeAhead', ['att.abs.tagBadges'])
\r
12174 .directive('focusMe',['$timeout', '$parse', function($timeout, $parse) {
\r
12176 link: function(scope, element, attrs) {
\r
12177 var model = $parse(attrs.focusMe);
\r
12178 scope.$watch(model, function(value) {
\r
12180 $timeout(function() {
\r
12181 element[0].focus();
\r
12182 scope.inputActive=true;
\r
12186 element.bind('blur', function() {
\r
12187 model.assign(scope, false);
\r
12188 scope.inputActive=false;
\r
12195 .directive('typeAhead', ['$timeout','$log', function($timeout,$log) {
\r
12198 templateUrl: 'app/scripts/ng_js_att_tpls/typeAhead/typeAhead.html',
\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
12216 scope.lineItems = [];
\r
12217 scope.filteredListLength = -1;
\r
12218 scope.filteredList = [];
\r
12219 scope.setFocus = function() {
\r
12220 scope.clickFocus = true;
\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
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
12238 scope.lineItems = scope.lineItems.concat(tempArr);
\r
12242 scope.current = 0;
\r
12243 scope.selected = true;
\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
12250 scope.dropdownLength=dropdownLength;
\r
12251 return scope.current === index;
\r
12254 scope.setCurrent = function(index) {
\r
12255 scope.current = index;
\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
12274 elem[0].querySelector('.list-scrollable').scrollTop = (scope.current - 1) * 35;
\r
12279 angular.module('att.abs.verticalSteptracker', ['ngSanitize'])
\r
12280 .directive('verticalSteptracker', [ function(){
\r
12283 transclude: true,
\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
12290 .directive('verticalSteptrackerStep',[ function(){
\r
12293 transclude: true,
\r
12299 templateUrl: 'app/scripts/ng_js_att_tpls/verticalSteptracker/vertical-step-tracker.html',
\r
12300 link: function(){}
\r
12303 .directive('attAbsLink',[ function(){
\r
12306 transclude: true,
\r
12308 template: '<span ng-transclude class="view-log"></span>'
\r
12311 angular.module('att.abs.videoControls', [])
\r
12312 .config(['$compileProvider' , function ($compileProvider) {
\r
12313 $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|javascript):/);
\r
12315 .directive('videoControls', [function() {
\r
12319 transclude: true,
\r
12320 templateUrl: 'app/scripts/ng_js_att_tpls/videoControls/videoControls.html'
\r
12323 .directive('photoControls', [function() {
\r
12327 transclude: true,
\r
12328 templateUrl: 'app/scripts/ng_js_att_tpls/videoControls/photoControls.html',
\r
12333 link: function(scope, elem, attr) {
\r
12334 if(!attr['prevLink']){
\r
12335 scope.prevLink = 'javascript:void(0)';
\r
12337 if(!attr['nextLink']){
\r
12338 scope.nextLink = 'javascript:void(0)';
\r
12341 prevLink : scope.prevLink,
\r
12342 nextLink : scope.nextLink
\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> {{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
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
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
12382 " <div class=\"att-accordion__bottom--border\"></div> \n" +
\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
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
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
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
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
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
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
12444 " <div class=\"centered\">Add board</div>\n" +
\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
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
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
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
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
12482 " <div class=\"circle\"></div>\n" +
\r
12483 " <div class=\"circle\"></div>\n" +
\r
12484 " <div class=\"circle\"></div>\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
12489 " <ul ng-class=\"{'dropdown-menu dots-dropdwn': type==='dots', 'dropdown-menu actions-dropdwn': type === 'actions'}\" ng-transclude></ul>\n" +
\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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
12592 " <tr ng-if=\"mode === 1\" class=\"divider\"><td colspan=\"{{nextRows[0].length}}\"><hr></td></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
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
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
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
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
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
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
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
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
12668 "<label for=\"ccForm.card\" class=\"pull-left\">Card number</label>");
\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
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
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
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
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
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
12714 " <span>{{day}}</span><br>\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
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
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
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
12745 " <div att-divider-lines class=\"divider-margin-s\"></div>\n" +
\r
12747 " <div ng-transclude></div>\n" +
\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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
12912 " <span>{{profile.state}}<span ng-if=\"badge\" class=\"status-badge\">Admin</span></span>\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
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\"> </div>\n" +
\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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
13094 " <div ng-transclude></div>\n" +
\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
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
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
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
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
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
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
13151 " <div ng-if='isRightLineShown' dir-type='{{iconStateConstants.DIR_TYPE.RIGHT}}' expandable-line></div>\n" +
\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
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
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
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
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
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
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
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
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
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
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
13249 " <div class='bigger-circle' ng-class=\"{'completed-color':isCompleted,'cancelled-color':isCancelled,'alert-color':isAlert}\">\n" +
\r
13252 " <div class='inactive-circle'>\n" +
\r
13255 " <div class='expandable-circle' ng-class=\"{'completed-color':isCompleted,'cancelled-color':isCancelled,'alert-color':isAlert}\">\n" +
\r
13258 " <div ng-class=\"{'below-info-box':isBelowInfoBoxShown, 'above-info-box': !isBelowInfoBoxShown}\" tabindex=\"0\">\n" +
\r
13260 " <div ng-if='isBelowInfoBoxShown' class='vertical-line'>\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
13269 " <div class='date' ng-mouseover='titleMouseover(2)' ng-mouseleave='titleMouseleave()' ng-bind='date'></div>\n" +
\r
13272 " <div ng-if='!isBelowInfoBoxShown' class='vertical-line'>\n" +
\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
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
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
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
13302 " <div ng-transclude></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
13312 " <div class=\"message\" ng-if=\"msgType==messageConstants.TABLE_MESSAGE_TYPES.magnifySearch\">\n" +
\r
13313 " <div class=\"img-magnify-glass\"></div>\n" +
\r
13315 " <p class=\"title\" tabindex=\"0\">Please input values to <br/> begin your search.</p>\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
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
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
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
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
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
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
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
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
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
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
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
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\"> </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\"> </i>\n" +
\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
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
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
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
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
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
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
13485 " <a title=\"{{links.prevLink}}\" aria-label=\"Previous Link\" ng-href=\"{{links.prevLink}}\"><i alt=\"previous\" class=\"icon-arrow-left\"> </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\"> </i></a>\n" +
\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
13497 " <div class=\"video-player__control video-player__track\">\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
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
13511 " <ul class=\"video-player__control video-player__volume\">\n" +
\r
13512 " <li class=\"video-player__volume-bar video-player__volume-bar--full\"> </li>\n" +
\r
13513 " <li class=\"video-player__volume-bar video-player__volume-bar--full\"> </li>\n" +
\r
13514 " <li class=\"video-player__volume-bar\"> </li>\n" +
\r
13515 " <li class=\"video-player__volume-bar\"> </li>\n" +
\r
13516 " <li class=\"video-player__volume-bar\"> </li>\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\"> </i></a>\n" +
\r
13525 })(angular, window);