/*********************************************** * ng-grid JavaScript Library * Authors: https://github.com/angular-ui/ng-grid/blob/master/README.md * License: MIT (http://www.opensource.org/licenses/mit-license.php) * Compiled At: 12/27/2012 16:39:37 ***********************************************/ (function(window){'use strict';if(!window.ng){window.ng={};} window.ngGrid={};window.ngGrid.i18n={};var ngGridServices=angular.module('ngGrid.services',[]);var ngGridDirectives=angular.module('ngGrid.directives',[]);var ngGridFilters=angular.module('ngGrid.filters',[]);var SELECTED_PROP='__ng_selected__';var EXCESS_ROWS=8;var SCROLL_THRESHOLD=6;var ASC="asc";var DESC="desc";var NG_FIELD='_ng_field_';var NG_DEPTH='_ng_depth_';var NG_HIDDEN='_ng_hidden_';var NG_COLUMN='_ng_column_';var CUSTOM_FILTERS=/CUSTOM_FILTERS/g;var TEMPLATE_REGEXP=/<.+>/;ng.moveSelectionHandler=function($scope,grid,evt){if(grid===null||grid===undefined){return true;} if(grid.config.selectedItems===undefined){return true;} var charCode=evt.which||evt.keyCode;var offset=(charCode==38?-1:(charCode==40?1:null));if(!offset){return true;} var items=$scope.renderedRows;var index=items.indexOf(grid.selectionService.lastClickedRow)+offset;if(index<0||index>=items.length){return true;} grid.selectionService.ChangeSelection(items[index],evt);if(index>items.length-EXCESS_ROWS){grid.$viewport.scrollTop(grid.$viewport.scrollTop()+(grid.config.rowHeight*2));}else if(index>>0;var from=Number(arguments[1])||0;from=(from<0)?Math.ceil(from):Math.floor(from);if(from<0){from+=len;} for(;from>>0;if(typeof fun!=="function"){throw new TypeError();} var res=[];var thisp=arguments[1];for(var i=0;i',iElems[0]);return version>4?version:undefined;})()};$.extend(ng.utils,{isIe6:(function(){return ng.utils.ieVersion===6;})(),isIe7:(function(){return ng.utils.ieVersion===7;})(),isIe:(function(){return ng.utils.ieVersion!==undefined;})()});ngGridFilters.filter('ngColumns',function(){return function(input){return input.filter(function(col){return!col.isAggCol;});};});ngGridFilters.filter('checkmark',function(){return function(input){return input?'\u2714':'\u2718';};});ngGridServices.factory('SortService',function(){var sortService={};sortService.colSortFnCache={};sortService.dateRE=/^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;sortService.guessSortFn=function(item){var sortFn,itemType,dateParts,month,day;if(item===undefined||item===null||item===''){return null;} itemType=typeof(item);switch(itemType){case"number":sortFn=sortService.sortNumber;break;case"boolean":sortFn=sortService.sortBool;break;default:sortFn=undefined;break;} if(sortFn){return sortFn;} if(Object.prototype.toString.call(item)==='[object Date]'){return sortService.sortDate;} if(itemType!=="string"){return sortService.basicSort;} if(item.match(/^-?[�$�]?[\d,.]+%?$/)){return sortService.sortNumberStr;} dateParts=item.match(sortService.dateRE);if(dateParts){month=parseInt(dateParts[1],10);day=parseInt(dateParts[2],10);if(month>12){return sortService.sortDDMMStr;}else if(day>12){return sortService.sortMMDDStr;}else{return sortService.sortMMDDStr;}} return sortService.sortAlpha;};sortService.basicSort=function(a,b){if(a==b){return 0;} if(a');$testContainer.appendTo('body');$testContainer.height(100).width(100).css("position","absolute").css("overflow","scroll");$testContainer.append('
');domUtilityService.ScrollH=($testContainer.height()-$testContainer[0].clientHeight);domUtilityService.ScrollW=($testContainer.width()-$testContainer[0].clientWidth);$testContainer.empty();$testContainer.attr('style','');$testContainer.append('M');domUtilityService.LetterW=$testContainer.children().first().width();$testContainer.remove();};domUtilityService.eventStorage={};domUtilityService.AssignGridContainers=function(rootEl,grid){grid.$root=$(rootEl);grid.$topPanel=grid.$root.find(".ngTopPanel");grid.$groupPanel=grid.$root.find(".ngGroupPanel");grid.$headerContainer=grid.$topPanel.find(".ngHeaderContainer");grid.$headerScroller=grid.$topPanel.find(".ngHeaderScroller");grid.$headers=grid.$headerScroller.children();grid.$viewport=grid.$root.find(".ngViewport");grid.$canvas=grid.$viewport.find(".ngCanvas");grid.$footerPanel=grid.$root.find(".ngFooterPanel");domUtilityService.UpdateGridLayout(grid);};domUtilityService.UpdateGridLayout=function(grid){var scrollTop=grid.$viewport.scrollTop();grid.elementDims.rootMaxW=grid.$root.width();grid.elementDims.rootMaxH=grid.$root.height();grid.refreshDomSizes();grid.adjustScrollTop(scrollTop,true);};domUtilityService.numberOfGrids=0;domUtilityService.BuildStyles=function($scope,grid,digest){var rowHeight=grid.config.rowHeight,$style=grid.$styleSheet,gridId=grid.gridId,css,cols=$scope.visibleColumns(),sumWidth=0;if(!$style){$style=$('#'+gridId);if(!$style[0]){$style=$("