removed unnecessary library nggrid from Admin UI
parent
72d045e277
commit
611e0aa036
|
@ -1,22 +0,0 @@
|
|||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
*.sln merge=union
|
||||
*.csproj merge=union
|
||||
*.vbproj merge=union
|
||||
*.fsproj merge=union
|
||||
*.dbproj merge=union
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
|
@ -1,157 +0,0 @@
|
|||
module.exports = function (grunt) {
|
||||
var stripBanner = function (src, options) {
|
||||
|
||||
if (!options) { options = {}; }
|
||||
var m = [];
|
||||
if (options.line) {
|
||||
// Strip // ... leading banners.
|
||||
m.push('(/{2,}[\\s\\S].*)');
|
||||
}
|
||||
if (options.block) {
|
||||
// Strips all /* ... */ block comment banners.
|
||||
m.push('(\/+\\*+[\\s\\S]*?\\*\\/+)');
|
||||
} else {
|
||||
// Strips only /* ... */ block comment banners, excluding /*! ... */.
|
||||
m.push('(\/+\\*+[^!][\\s\\S]*?\\*\\/+)');
|
||||
|
||||
}
|
||||
var re = new RegExp('\s*(' + m.join('|') + ')\s*', 'g');
|
||||
src = src.replace(re, '');
|
||||
src = src.replace(/\s{2,}(\r|\n|\s){2,}$/gm, '');
|
||||
return src;
|
||||
};
|
||||
|
||||
grunt.registerMultiTask('concat', 'Concatenate files.', function () {
|
||||
// Merge task-specific and/or target-specific options with these defaults.
|
||||
var options = this.options({
|
||||
separator: grunt.util.linefeed,
|
||||
banner: '',
|
||||
footer: '',
|
||||
stripBanners: false,
|
||||
process: false
|
||||
});
|
||||
// Normalize boolean options that accept options objects.
|
||||
if (typeof options.stripBanners === 'boolean' && options.stripBanners === true) { options.stripBanners = {}; }
|
||||
if (typeof options.process === 'boolean' && options.process === true) { options.process = {}; }
|
||||
|
||||
// Process banner and footer.
|
||||
var banner = grunt.template.process(options.banner);
|
||||
var footer = grunt.template.process(options.footer);
|
||||
|
||||
// Iterate over all src-dest file pairs.
|
||||
this.files.forEach(function (f) {
|
||||
// Concat banner + specified files + footer.
|
||||
var src = banner + f.src.filter(function (filepath) {
|
||||
// Warn on and remove invalid source files (if nonull was set).
|
||||
if (!grunt.file.exists(filepath)) {
|
||||
grunt.log.warn('Source file "' + filepath + '" not found.');
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}).map(function (filepath) {
|
||||
// Read file source.
|
||||
var src = grunt.file.read(filepath);
|
||||
// Process files as templates if requested.
|
||||
if (options.process) {
|
||||
src = grunt.template.process(src, options.process);
|
||||
}
|
||||
// Strip banners if requested.
|
||||
if (options.stripBanners) {
|
||||
src = stripBanner(src, options.stripBanners);
|
||||
}
|
||||
return src;
|
||||
}).join(grunt.util.normalizelf(options.separator)) + footer;
|
||||
|
||||
// Write the destination file.
|
||||
grunt.file.write(f.dest, src);
|
||||
|
||||
// Print a success message.
|
||||
grunt.log.writeln('File "' + f.dest + '" created.');
|
||||
});
|
||||
});
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
templates: [
|
||||
'src/templates/**.html'
|
||||
],
|
||||
srcFiles: [
|
||||
'src/*.js',
|
||||
'src/filters/*.js',
|
||||
'src/services/*.js',
|
||||
'src/classes/*.js',
|
||||
|
||||
'src/directives/*.js',
|
||||
'src/i18n/*.js',
|
||||
'<%= ngtemplates.ngGrid.dest %>'
|
||||
],
|
||||
ngtemplates: {
|
||||
ngGrid: {
|
||||
options: { base: 'src/templates' },
|
||||
src: ['src/templates/**.html'],
|
||||
dest: 'build/templates.js'
|
||||
}
|
||||
},
|
||||
concat: {
|
||||
options: {
|
||||
banner: '/***********************************************\n' +
|
||||
'* ng-grid JavaScript Library\n' +
|
||||
'* Authors: https://github.com/angular-ui/ng-grid/blob/master/README.md \n' +
|
||||
'* License: MIT (http://www.opensource.org/licenses/mit-license.php)\n' +
|
||||
'* Compiled At: <%= grunt.template.today("mm/dd/yyyy HH:MM") %>\n' +
|
||||
'***********************************************/\n' +
|
||||
'(function(window, $) {\n' +
|
||||
'\'use strict\';\n',
|
||||
footer: '\n}(window, jQuery));'
|
||||
},
|
||||
prod: {
|
||||
options: {
|
||||
stripBanners: {
|
||||
block: true,
|
||||
line: true
|
||||
}
|
||||
},
|
||||
src: ['<%= srcFiles %>'],
|
||||
dest: 'build/<%= pkg.name %>.js'
|
||||
},
|
||||
debug: {
|
||||
src: ['<%= srcFiles %>'],
|
||||
dest: 'build/<%= pkg.name %>.debug.js'
|
||||
},
|
||||
version: {
|
||||
src: ['<%= srcFiles %>'],
|
||||
dest: '<%= pkg.name %>-<%= pkg.version %>.debug.js'
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
build: {
|
||||
src: 'build/<%= pkg.name %>.js',
|
||||
dest: 'build/<%= pkg.name %>.min.js'
|
||||
},
|
||||
version: {
|
||||
src: '<%= pkg.name %>-<%= pkg.version %>.debug.js',
|
||||
dest: '<%= pkg.name %>-<%= pkg.version %>.min.js'
|
||||
}
|
||||
},
|
||||
clean: {
|
||||
templates: {
|
||||
src: ["<%= ngtemplates.ngGrid.dest %>"]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Load the plugin that provides the "uglify" task.
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
//grunt.loadNpmTasks('grunt-contrib-concat');
|
||||
grunt.loadNpmTasks('grunt-jsdoc');
|
||||
grunt.loadNpmTasks('grunt-angular-templates');
|
||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||
// Default task(s).
|
||||
grunt.registerTask('default', ['ngtemplates', 'concat', 'uglify', 'clean']);
|
||||
grunt.registerTask('debug', ['ngtemplates', 'concat:debug', 'clean']);
|
||||
grunt.registerTask('prod', ['ngtemplates', 'concat:prod', 'uglify', 'clean']);
|
||||
grunt.registerTask('version', ['ngtemplates', 'concat:version', 'uglify:version', 'clean']);
|
||||
|
||||
};
|
|
@ -1,93 +0,0 @@
|
|||
#ng-grid : An Angular DataGrid#
|
||||
|
||||
__Contributors:__
|
||||
|
||||
ng-grid Team:
|
||||
* [Tim Sweet](http://ornerydevelopment.blogspot.com/)
|
||||
* [Jonathon Ricaurte](https://github.com/jonricaurte)
|
||||
|
||||
License: [MIT](http://www.opensource.org/licenses/mit-license.php)
|
||||
|
||||
Dependencies: jQuery & angular.js. (JqueryUi draggable for non-HTML5 compliant browsers to use awesome Drag-N-Drop aggregate feature. However, you can still groupby without draggability)
|
||||
***
|
||||
##About##
|
||||
__ng-grid__ Originally built on knockout we wanted to port it to angular.
|
||||
|
||||
version 2.0.2
|
||||
|
||||
[nuGet](https://nuget.org/packages/ng-grid)
|
||||
|
||||
|
||||
Questions, Comments, Complaints? feel free to email us at nggridteam@gmail.com
|
||||
|
||||
***
|
||||
##Roadmap##
|
||||
|
||||
We are going to be adding more features here as we head to a 3.0 release, including:
|
||||
|
||||
* Anything else the rest of the community wants to contribute that isn't a terrible idea. :)
|
||||
|
||||
***
|
||||
_The bare bones_:
|
||||
|
||||
```html
|
||||
<script type="text/javascript" src="angular.js"></script>
|
||||
<script type="text/javascript" src="ng-grid.js"></script>
|
||||
<script>
|
||||
angular.module('myApp',['ngGrid', ... {other includes}]);
|
||||
</script>
|
||||
<link rel="stylesheet" type="text/css" href="../ng-grid.css" />
|
||||
<body ng-app="myApp">
|
||||
<div ng-grid="myOptions"></div>
|
||||
<body>
|
||||
```
|
||||
```javascript
|
||||
// Define your own controller somewhere..
|
||||
function MyCtrl($scope) {
|
||||
$scope.myData = [{name: "Moroni", age: 50},
|
||||
{name: "Teancum", age: 43},
|
||||
{name: "Jacob", age: 27},
|
||||
{name: "Nephi", age: 29},
|
||||
{name: "Enos", age: 34}];
|
||||
$scope.myOptions = { data: 'myData' };
|
||||
// you can also specify data as: $scope.myOptions = { data: $scope.myData }.
|
||||
// However, updates to the underlying data will not be reflected in the grid
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
##Want More?##
|
||||
Check out the [Getting Started](https://github.com/angular-ui/ng-grid/wiki/Getting-started) and other [Docs](https://github.com/angular-ui/ng-grid/wiki)
|
||||
|
||||
##Examples##
|
||||
[Examples](http://angular-ui.github.com/ng-grid/)
|
||||
|
||||
##Change Log##
|
||||
* __2013-03-08__ - Version 2.0.2 - minor bugfixes, updating some plugins.
|
||||
* __2013-03-05__ - Version 2.0.1 - Moved to grunt build system. No more international version; all languages are included by default. Fixed minor grouping display issue. Using $templateCache for templates instead of global namespace.
|
||||
* __2013-03-05__ - Version 2.0.0 - Breaking Changes: see documentation (showSelectionBox, enableRowSelection, showFooter). Column Virtualization added. Row virtualization performance improved. Excel-like editing instead of enableFocusedCellEdit.
|
||||
* __2013-02-18__ - Version 1.9.0 - Aggregates now display correctly. Added more option methods to select and group data (see wiki), Added column pinning.
|
||||
* __2013-02-11__ - Version 1.8.0.hotfix - Fixes for multi-level grouping and adding the gridId to both the grid options and as argument to the "ngGridEventData" so you can identify what grid it came from.
|
||||
* __2013-02-07__ - Version 1.8.0 - Major architectural changes which greatly improves performance. virtualizationThreshold now controlls when virtualization is force-enabled and is user-specified in options.
|
||||
* __2013-02-06__ - Version 1.7.1 - Fixed bug with selections and multiple grids. New emit message for notifying when hitting bottom of viewport. Can disable virtualization. ng-grid virtualization is on by default, but can be disabled if there are less than 50 rows in the grid. Anything > 50 rows virtualization is forced on for performance considerations.
|
||||
* __2013-02-05__ - Version 1.7.0 - BREAKING CHANGES: Will add examples. Adding cell selection, navigation, and edit on focus. Added programmatic selections. Improved scrolling. ngGridEvents changed/added: see wiki.
|
||||
* __2013-01-17__ - Version 1.6.3 - Can now highlight/copy text in grid. Fixed multiple issues when using multiselect along with shift key. Refactored key events so now they are all in the same directive for viewport. Hovering over highlightable text will change cursors in viewport. Fixed #93.
|
||||
* __2013-01-09__ - Version 1.6.2 - Merged changes to have two-way data-binding work in templates, so if you're using a celltemplate, you can now use COL_FIELD instead of row.getProperty(col.field). row.getProperty is still in the row class for accessing other row values.
|
||||
* __2013-01-08__ - Version 1.6.1 - Adding ability to preselect rows. Can deselect when multiSelect:false. Bug fixes/merging pull requests. Bower now works. Can now sync external search with ng-grid internal search. Check out other examples on examples page.
|
||||
* __2012-12-27__ - Version 1.6.0 - Adding i18n support and support for different angularjs interpolation symbols (requires building from source).
|
||||
* __2012-12-20__ - Version 1.5.0 - Modifying the way we watch for array changes. Added groupable column definition option. Bugfixes for #58, #59.
|
||||
* __2012-12-18__ - Version 1.4.1 - jslint reformat, minor bugfixes, performance improvements while keydown navigating, adding "use strict" to script.
|
||||
* __2012-12-12__ - Version 1.4.0 - Massive improvements to search thanks to [iNeedFat](https://github.com/ineedfat)!
|
||||
* __2012-12-12__ - Version 1.3.9 - Refactored and removed unneeded code. Added scope events.
|
||||
* __2012-12-12__ - Version 1.3.7 - Improving template compilation and fixing jquery theme support. Improving comments on grid options.
|
||||
* __2012-12-06__ - Version 1.3.6 - sortInfo can now be set to default sort the grid. Improvements to the beforeSelectionChange callback mechanism when multi-selecting.
|
||||
* __2012-12-06__ - Version 1.3.5 - Improved template rendering when using external template files. columnDefs can now be a $scope object which can be push/pop/spliced. Fixed box model for cells and header cells.
|
||||
* __2012-12-04__ - Version 1.3.4 - Improved aggregate grouping, minor bugfixes. Auto-width works!
|
||||
* __2012-11-27__ - Version 1.3.2 - Changed default width behavior to use *s and added option to maintain column ratios while resizing
|
||||
* __2012-11-27__ - Version 1.3.1 - Added layout plugin. Support for uri templates. Performance improvements.
|
||||
* __2012-11-23__ - Version 1.3.0 - Major code refactoring, can now group-by using column menu, changes to build
|
||||
* __2012-11-21__ - Version 1.2.2 - Built-in filtering support, numerous perfomance enhancements and minor code refactoring
|
||||
* __2012-11-20__ - Version 1.2.1 - Added ability to specify property "paths" as fields and for grid options.
|
||||
* __2012-11-19__ - Version 1.2.0 - Added Server-Side Paging support and minor bug fixes.
|
||||
* __2012-11-17__ - Version 1.1.0 - Added ability to hide/show columns and various bug fixes/performance enhancements.
|
||||
* __2012-11-14__ - Version 1.0.0 Release
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"name": "ng-grid",
|
||||
"version": "2.0.3",
|
||||
"main": ["./ng-grid.css", "./build/ng-grid.min.js"]
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
// Testacular configuration
|
||||
// Generated on Thu Mar 07 2013 10:13:03 GMT-0800 (Pacific Standard Time)
|
||||
|
||||
|
||||
// base path, that will be used to resolve files and exclude
|
||||
basePath = '';
|
||||
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files = [
|
||||
JASMINE,
|
||||
JASMINE_ADAPTER,
|
||||
'lib/jquery-1.9.1.js',
|
||||
'lib/angular.js',
|
||||
'test/lib/angular/angular-mocks.js',
|
||||
'build/ng-grid.debug.js',
|
||||
'test/unit/*Spec.js'
|
||||
];
|
||||
|
||||
// list of files to exclude
|
||||
exclude = [];
|
||||
|
||||
// use dots reporter, as travis terminal does not support escaping sequences
|
||||
// possible values: 'dots' || 'progress'
|
||||
reporter = 'progress';
|
||||
|
||||
// these are default values, just to show available options
|
||||
|
||||
// web server port
|
||||
port = 8080;
|
||||
|
||||
// cli runner port
|
||||
runnerPort = 9100;
|
||||
|
||||
// enable / disable colors in the output (reporters and logs)
|
||||
colors = true;
|
||||
|
||||
// level of logging
|
||||
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
|
||||
logLevel = LOG_DEBUG;
|
||||
|
||||
// enable / disable watching file and executing tests whenever any file changes
|
||||
autoWatch = false;
|
||||
|
||||
// polling interval in ms (ignored on OS that support inotify)
|
||||
autoWatchInterval = 0;
|
File diff suppressed because it is too large
Load Diff
|
@ -1,159 +0,0 @@
|
|||
/*
|
||||
AngularJS v1.0.3
|
||||
(c) 2010-2012 Google, Inc. http://angularjs.org
|
||||
License: MIT
|
||||
*/
|
||||
(function(U,ca,p){'use strict';function m(b,a,c){var d;if(b)if(N(b))for(d in b)d!="prototype"&&d!="length"&&d!="name"&&b.hasOwnProperty(d)&&a.call(c,b[d],d);else if(b.forEach&&b.forEach!==m)b.forEach(a,c);else if(L(b)&&wa(b.length))for(d=0;d<b.length;d++)a.call(c,b[d],d);else for(d in b)b.hasOwnProperty(d)&&a.call(c,b[d],d);return b}function lb(b){var a=[],c;for(c in b)b.hasOwnProperty(c)&&a.push(c);return a.sort()}function ec(b,a,c){for(var d=lb(b),e=0;e<d.length;e++)a.call(c,b[d[e]],d[e]);return d}
|
||||
function mb(b){return function(a,c){b(c,a)}}function xa(){for(var b=Z.length,a;b;){b--;a=Z[b].charCodeAt(0);if(a==57)return Z[b]="A",Z.join("");if(a==90)Z[b]="0";else return Z[b]=String.fromCharCode(a+1),Z.join("")}Z.unshift("0");return Z.join("")}function x(b){m(arguments,function(a){a!==b&&m(a,function(a,d){b[d]=a})});return b}function G(b){return parseInt(b,10)}function ya(b,a){return x(new (x(function(){},{prototype:b})),a)}function D(){}function ma(b){return b}function I(b){return function(){return b}}
|
||||
function t(b){return typeof b=="undefined"}function v(b){return typeof b!="undefined"}function L(b){return b!=null&&typeof b=="object"}function F(b){return typeof b=="string"}function wa(b){return typeof b=="number"}function na(b){return Sa.apply(b)=="[object Date]"}function J(b){return Sa.apply(b)=="[object Array]"}function N(b){return typeof b=="function"}function oa(b){return b&&b.document&&b.location&&b.alert&&b.setInterval}function R(b){return F(b)?b.replace(/^\s*/,"").replace(/\s*$/,""):b}function fc(b){return b&&
|
||||
(b.nodeName||b.bind&&b.find)}function Ta(b,a,c){var d=[];m(b,function(b,g,i){d.push(a.call(c,b,g,i))});return d}function gc(b,a){var c=0,d;if(J(b)||F(b))return b.length;else if(L(b))for(d in b)(!a||b.hasOwnProperty(d))&&c++;return c}function za(b,a){if(b.indexOf)return b.indexOf(a);for(var c=0;c<b.length;c++)if(a===b[c])return c;return-1}function Ua(b,a){var c=za(b,a);c>=0&&b.splice(c,1);return a}function V(b,a){if(oa(b)||b&&b.$evalAsync&&b.$watch)throw B("Can't copy Window or Scope");if(a){if(b===
|
||||
a)throw B("Can't copy equivalent objects or arrays");if(J(b)){for(;a.length;)a.pop();for(var c=0;c<b.length;c++)a.push(V(b[c]))}else for(c in m(a,function(b,c){delete a[c]}),b)a[c]=V(b[c])}else(a=b)&&(J(b)?a=V(b,[]):na(b)?a=new Date(b.getTime()):L(b)&&(a=V(b,{})));return a}function hc(b,a){var a=a||{},c;for(c in b)b.hasOwnProperty(c)&&c.substr(0,2)!=="$$"&&(a[c]=b[c]);return a}function ha(b,a){if(b===a)return!0;if(b===null||a===null)return!1;if(b!==b&&a!==a)return!0;var c=typeof b,d;if(c==typeof a&&
|
||||
c=="object")if(J(b)){if((c=b.length)==a.length){for(d=0;d<c;d++)if(!ha(b[d],a[d]))return!1;return!0}}else if(na(b))return na(a)&&b.getTime()==a.getTime();else{if(b&&b.$evalAsync&&b.$watch||a&&a.$evalAsync&&a.$watch||oa(b)||oa(a))return!1;c={};for(d in b){if(d.charAt(0)!=="$"&&!N(b[d])&&!ha(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!c[d]&&d.charAt(0)!=="$"&&!N(a[d]))return!1;return!0}return!1}function Va(b,a){var c=arguments.length>2?ia.call(arguments,2):[];return N(a)&&!(a instanceof RegExp)?c.length?
|
||||
function(){return arguments.length?a.apply(b,c.concat(ia.call(arguments,0))):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}:a}function ic(b,a){var c=a;/^\$+/.test(b)?c=p:oa(a)?c="$WINDOW":a&&ca===a?c="$DOCUMENT":a&&a.$evalAsync&&a.$watch&&(c="$SCOPE");return c}function da(b,a){return JSON.stringify(b,ic,a?" ":null)}function nb(b){return F(b)?JSON.parse(b):b}function Wa(b){b&&b.length!==0?(b=E(""+b),b=!(b=="f"||b=="0"||b=="false"||b=="no"||b=="n"||b=="[]")):b=!1;
|
||||
return b}function pa(b){b=u(b).clone();try{b.html("")}catch(a){}return u("<div>").append(b).html().match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+E(b)})}function Xa(b){var a={},c,d;m((b||"").split("&"),function(b){b&&(c=b.split("="),d=decodeURIComponent(c[0]),a[d]=v(c[1])?decodeURIComponent(c[1]):!0)});return a}function ob(b){var a=[];m(b,function(b,d){a.push(Ya(d,!0)+(b===!0?"":"="+Ya(b,!0)))});return a.length?a.join("&"):""}function Za(b){return Ya(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,
|
||||
"=").replace(/%2B/gi,"+")}function Ya(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(a?null:/%20/g,"+")}function jc(b,a){function c(a){a&&d.push(a)}var d=[b],e,g,i=["ng:app","ng-app","x-ng-app","data-ng-app"],f=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;m(i,function(a){i[a]=!0;c(ca.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(m(b.querySelectorAll("."+a),c),m(b.querySelectorAll("."+a+"\\:"),c),m(b.querySelectorAll("["+
|
||||
a+"]"),c))});m(d,function(a){if(!e){var b=f.exec(" "+a.className+" ");b?(e=a,g=(b[2]||"").replace(/\s+/g,",")):m(a.attributes,function(b){if(!e&&i[b.name])e=a,g=b.value})}});e&&a(e,g?[g]:[])}function pb(b,a){b=u(b);a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");var c=qb(a);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,i){a.$apply(function(){b.data("$injector",i);c(b)(a)})}]);return c}function $a(b,a){a=a||"_";return b.replace(kc,
|
||||
function(b,d){return(d?a:"")+b.toLowerCase()})}function qa(b,a,c){if(!b)throw new B("Argument '"+(a||"?")+"' is "+(c||"required"));return b}function ra(b,a,c){c&&J(b)&&(b=b[b.length-1]);qa(N(b),a,"not a function, got "+(b&&typeof b=="object"?b.constructor.name||"Object":typeof b));return b}function lc(b){function a(a,b,e){return a[b]||(a[b]=e())}return a(a(b,"angular",Object),"module",function(){var b={};return function(d,e,g){e&&b.hasOwnProperty(d)&&(b[d]=null);return a(b,d,function(){function a(c,
|
||||
d,e){return function(){b[e||"push"]([c,d,arguments]);return j}}if(!e)throw B("No module: "+d);var b=[],c=[],k=a("$injector","invoke"),j={_invokeQueue:b,_runBlocks:c,requires:e,name:d,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:k,run:function(a){c.push(a);
|
||||
return this}};g&&k(g);return j})}})}function rb(b){return b.replace(mc,function(a,b,d,e){return e?d.toUpperCase():d}).replace(nc,"Moz$1")}function ab(b,a){function c(){var e;for(var b=[this],c=a,i,f,h,k,j,l;b.length;){i=b.shift();f=0;for(h=i.length;f<h;f++){k=u(i[f]);c?k.triggerHandler("$destroy"):c=!c;j=0;for(e=(l=k.children()).length,k=e;j<k;j++)b.push(ja(l[j]))}}return d.apply(this,arguments)}var d=ja.fn[b],d=d.$original||d;c.$original=d;ja.fn[b]=c}function Q(b){if(b instanceof Q)return b;if(!(this instanceof
|
||||
Q)){if(F(b)&&b.charAt(0)!="<")throw B("selectors not implemented");return new Q(b)}if(F(b)){var a=ca.createElement("div");a.innerHTML="<div> </div>"+b;a.removeChild(a.firstChild);bb(this,a.childNodes);this.remove()}else bb(this,b)}function cb(b){return b.cloneNode(!0)}function sa(b){sb(b);for(var a=0,b=b.childNodes||[];a<b.length;a++)sa(b[a])}function tb(b,a,c){var d=$(b,"events");$(b,"handle")&&(t(a)?m(d,function(a,c){db(b,c,a);delete d[c]}):t(c)?(db(b,a,d[a]),delete d[a]):Ua(d[a],c))}function sb(b){var a=
|
||||
b[Aa],c=Ba[a];c&&(c.handle&&(c.events.$destroy&&c.handle({},"$destroy"),tb(b)),delete Ba[a],b[Aa]=p)}function $(b,a,c){var d=b[Aa],d=Ba[d||-1];if(v(c))d||(b[Aa]=d=++oc,d=Ba[d]={}),d[a]=c;else return d&&d[a]}function ub(b,a,c){var d=$(b,"data"),e=v(c),g=!e&&v(a),i=g&&!L(a);!d&&!i&&$(b,"data",d={});if(e)d[a]=c;else if(g)if(i)return d&&d[a];else x(d,a);else return d}function Ca(b,a){return(" "+b.className+" ").replace(/[\n\t]/g," ").indexOf(" "+a+" ")>-1}function vb(b,a){a&&m(a.split(" "),function(a){b.className=
|
||||
R((" "+b.className+" ").replace(/[\n\t]/g," ").replace(" "+R(a)+" "," "))})}function wb(b,a){a&&m(a.split(" "),function(a){if(!Ca(b,a))b.className=R(b.className+" "+R(a))})}function bb(b,a){if(a)for(var a=!a.nodeName&&v(a.length)&&!oa(a)?a:[a],c=0;c<a.length;c++)b.push(a[c])}function xb(b,a){return Da(b,"$"+(a||"ngController")+"Controller")}function Da(b,a,c){b=u(b);for(b[0].nodeType==9&&(b=b.find("html"));b.length;){if(c=b.data(a))return c;b=b.parent()}}function yb(b,a){var c=Ea[a.toLowerCase()];
|
||||
return c&&zb[b.nodeName]&&c}function pc(b,a){var c=function(c,e){if(!c.preventDefault)c.preventDefault=function(){c.returnValue=!1};if(!c.stopPropagation)c.stopPropagation=function(){c.cancelBubble=!0};if(!c.target)c.target=c.srcElement||ca;if(t(c.defaultPrevented)){var g=c.preventDefault;c.preventDefault=function(){c.defaultPrevented=!0;g.call(c)};c.defaultPrevented=!1}c.isDefaultPrevented=function(){return c.defaultPrevented};m(a[e||c.type],function(a){a.call(b,c)});aa<=8?(c.preventDefault=null,
|
||||
c.stopPropagation=null,c.isDefaultPrevented=null):(delete c.preventDefault,delete c.stopPropagation,delete c.isDefaultPrevented)};c.elem=b;return c}function ga(b){var a=typeof b,c;if(a=="object"&&b!==null)if(typeof(c=b.$$hashKey)=="function")c=b.$$hashKey();else{if(c===p)c=b.$$hashKey=xa()}else c=b;return a+":"+c}function Fa(b){m(b,this.put,this)}function eb(){}function Ab(b){var a,c;if(typeof b=="function"){if(!(a=b.$inject))a=[],c=b.toString().replace(qc,""),c=c.match(rc),m(c[1].split(sc),function(b){b.replace(tc,
|
||||
function(b,c,d){a.push(d)})}),b.$inject=a}else J(b)?(c=b.length-1,ra(b[c],"fn"),a=b.slice(0,c)):ra(b,"fn",!0);return a}function qb(b){function a(a){return function(b,c){if(L(b))m(b,mb(a));else return a(b,c)}}function c(a,b){N(b)&&(b=l.instantiate(b));if(!b.$get)throw B("Provider "+a+" must define $get factory method.");return j[a+f]=b}function d(a,b){return c(a,{$get:b})}function e(a){var b=[];m(a,function(a){if(!k.get(a))if(k.put(a,!0),F(a)){var c=ta(a);b=b.concat(e(c.requires)).concat(c._runBlocks);
|
||||
try{for(var d=c._invokeQueue,c=0,f=d.length;c<f;c++){var h=d[c],g=h[0]=="$injector"?l:l.get(h[0]);g[h[1]].apply(g,h[2])}}catch(n){throw n.message&&(n.message+=" from "+a),n;}}else if(N(a))try{b.push(l.invoke(a))}catch(i){throw i.message&&(i.message+=" from "+a),i;}else if(J(a))try{b.push(l.invoke(a))}catch(j){throw j.message&&(j.message+=" from "+String(a[a.length-1])),j;}else ra(a,"module")});return b}function g(a,b){function c(d){if(typeof d!=="string")throw B("Service name expected");if(a.hasOwnProperty(d)){if(a[d]===
|
||||
i)throw B("Circular dependency: "+h.join(" <- "));return a[d]}else try{return h.unshift(d),a[d]=i,a[d]=b(d)}finally{h.shift()}}function d(a,b,e){var f=[],k=Ab(a),g,n,i;n=0;for(g=k.length;n<g;n++)i=k[n],f.push(e&&e.hasOwnProperty(i)?e[i]:c(i,h));a.$inject||(a=a[g]);switch(b?-1:f.length){case 0:return a();case 1:return a(f[0]);case 2:return a(f[0],f[1]);case 3:return a(f[0],f[1],f[2]);case 4:return a(f[0],f[1],f[2],f[3]);case 5:return a(f[0],f[1],f[2],f[3],f[4]);case 6:return a(f[0],f[1],f[2],f[3],
|
||||
f[4],f[5]);case 7:return a(f[0],f[1],f[2],f[3],f[4],f[5],f[6]);case 8:return a(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7]);case 9:return a(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8]);case 10:return a(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9]);default:return a.apply(b,f)}}return{invoke:d,instantiate:function(a,b){var c=function(){},e;c.prototype=(J(a)?a[a.length-1]:a).prototype;c=new c;e=d(a,c,b);return L(e)?e:c},get:c,annotate:Ab}}var i={},f="Provider",h=[],k=new Fa,j={$provide:{provider:a(c),
|
||||
factory:a(d),service:a(function(a,b){return d(a,["$injector",function(a){return a.instantiate(b)}])}),value:a(function(a,b){return d(a,I(b))}),constant:a(function(a,b){j[a]=b;o[a]=b}),decorator:function(a,b){var c=l.get(a+f),d=c.$get;c.$get=function(){var a=r.invoke(d,c);return r.invoke(b,null,{$delegate:a})}}}},l=g(j,function(){throw B("Unknown provider: "+h.join(" <- "));}),o={},r=o.$injector=g(o,function(a){a=l.get(a+f);return r.invoke(a.$get,a)});m(e(b),function(a){r.invoke(a||D)});return r}function uc(){var b=
|
||||
!0;this.disableAutoScrolling=function(){b=!1};this.$get=["$window","$location","$rootScope",function(a,c,d){function e(a){var b=null;m(a,function(a){!b&&E(a.nodeName)==="a"&&(b=a)});return b}function g(){var b=c.hash(),d;b?(d=i.getElementById(b))?d.scrollIntoView():(d=e(i.getElementsByName(b)))?d.scrollIntoView():b==="top"&&a.scrollTo(0,0):a.scrollTo(0,0)}var i=a.document;b&&d.$watch(function(){return c.hash()},function(){d.$evalAsync(g)});return g}]}function vc(b,a,c,d){function e(a){try{a.apply(null,
|
||||
ia.call(arguments,1))}finally{if(n--,n===0)for(;w.length;)try{w.pop()()}catch(b){c.error(b)}}}function g(a,b){(function ea(){m(q,function(a){a()});s=b(ea,a)})()}function i(){O!=f.url()&&(O=f.url(),m(A,function(a){a(f.url())}))}var f=this,h=a[0],k=b.location,j=b.history,l=b.setTimeout,o=b.clearTimeout,r={};f.isMock=!1;var n=0,w=[];f.$$completeOutstandingRequest=e;f.$$incOutstandingRequestCount=function(){n++};f.notifyWhenNoOutstandingRequests=function(a){m(q,function(a){a()});n===0?a():w.push(a)};
|
||||
var q=[],s;f.addPollFn=function(a){t(s)&&g(100,l);q.push(a);return a};var O=k.href,C=a.find("base");f.url=function(a,b){if(a){if(O!=a)return O=a,d.history?b?j.replaceState(null,"",a):(j.pushState(null,"",a),C.attr("href",C.attr("href"))):b?k.replace(a):k.href=a,f}else return k.href.replace(/%27/g,"'")};var A=[],K=!1;f.onUrlChange=function(a){K||(d.history&&u(b).bind("popstate",i),d.hashchange?u(b).bind("hashchange",i):f.addPollFn(i),K=!0);A.push(a);return a};f.baseHref=function(){var a=C.attr("href");
|
||||
return a?a.replace(/^https?\:\/\/[^\/]*/,""):a};var W={},y="",M=f.baseHref();f.cookies=function(a,b){var d,e,f,k;if(a)if(b===p)h.cookie=escape(a)+"=;path="+M+";expires=Thu, 01 Jan 1970 00:00:00 GMT";else{if(F(b))d=(h.cookie=escape(a)+"="+escape(b)+";path="+M).length+1,d>4096&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!"),W.length>20&&c.warn("Cookie '"+a+"' possibly not set or overflowed because too many cookies were already set ("+W.length+
|
||||
" > 20 )")}else{if(h.cookie!==y){y=h.cookie;d=y.split("; ");W={};for(f=0;f<d.length;f++)e=d[f],k=e.indexOf("="),k>0&&(W[unescape(e.substring(0,k))]=unescape(e.substring(k+1)))}return W}};f.defer=function(a,b){var c;n++;c=l(function(){delete r[c];e(a)},b||0);r[c]=!0;return c};f.defer.cancel=function(a){return r[a]?(delete r[a],o(a),e(D),!0):!1}}function wc(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new vc(b,d,a,c)}]}function xc(){this.$get=function(){function b(b,
|
||||
d){function e(a){if(a!=l){if(o){if(o==a)o=a.n}else o=a;g(a.n,a.p);g(a,l);l=a;l.n=null}}function g(a,b){if(a!=b){if(a)a.p=b;if(b)b.n=a}}if(b in a)throw B("cacheId "+b+" taken");var i=0,f=x({},d,{id:b}),h={},k=d&&d.capacity||Number.MAX_VALUE,j={},l=null,o=null;return a[b]={put:function(a,b){var c=j[a]||(j[a]={key:a});e(c);t(b)||(a in h||i++,h[a]=b,i>k&&this.remove(o.key))},get:function(a){var b=j[a];if(b)return e(b),h[a]},remove:function(a){var b=j[a];if(b){if(b==l)l=b.p;if(b==o)o=b.n;g(b.n,b.p);delete j[a];
|
||||
delete h[a];i--}},removeAll:function(){h={};i=0;j={};l=o=null},destroy:function(){j=f=h=null;delete a[b]},info:function(){return x({},f,{size:i})}}}var a={};b.info=function(){var b={};m(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function yc(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function Bb(b){var a={},c="Directive",d=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,e=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,g="Template must have exactly one root element. was: ";
|
||||
this.directive=function f(d,e){F(d)?(qa(e,"directive"),a.hasOwnProperty(d)||(a[d]=[],b.factory(d+c,["$injector","$exceptionHandler",function(b,c){var e=[];m(a[d],function(a){try{var f=b.invoke(a);if(N(f))f={compile:I(f)};else if(!f.compile&&f.link)f.compile=I(f.link);f.priority=f.priority||0;f.name=f.name||d;f.require=f.require||f.controller&&f.name;f.restrict=f.restrict||"A";e.push(f)}catch(k){c(k)}});return e}])),a[d].push(e)):m(d,mb(f));return this};this.$get=["$injector","$interpolate","$exceptionHandler",
|
||||
"$http","$templateCache","$parse","$controller","$rootScope",function(b,h,k,j,l,o,r,n){function w(a,b,c){a instanceof u||(a=u(a));m(a,function(b,c){b.nodeType==3&&(a[c]=u(b).wrap("<span></span>").parent()[0])});var d=s(a,b,a,c);return function(b,c){qa(b,"scope");var e=c?ua.clone.call(a):a;e.data("$scope",b);q(e,"ng-scope");c&&c(e,b);d&&d(b,e,e);return e}}function q(a,b){try{a.addClass(b)}catch(c){}}function s(a,b,c,d){function e(a,c,d,k){for(var g,h,j,n,o,l=0,r=0,q=f.length;l<q;r++)j=c[r],g=f[l++],
|
||||
h=f[l++],g?(g.scope?(n=a.$new(L(g.scope)),u(j).data("$scope",n)):n=a,(o=g.transclude)||!k&&b?g(h,n,j,d,function(b){return function(c){var d=a.$new();return b(d,c).bind("$destroy",Va(d,d.$destroy))}}(o||b)):g(h,n,j,p,k)):h&&h(a,j.childNodes,p,k)}for(var f=[],k,g,h,j=0;j<a.length;j++)g=new ea,k=O(a[j],[],g,d),g=(k=k.length?C(k,a[j],g,b,c):null)&&k.terminal||!a[j].childNodes.length?null:s(a[j].childNodes,k?k.transclude:b),f.push(k),f.push(g),h=h||k||g;return h?e:null}function O(a,b,c,f){var k=c.$attr,
|
||||
g;switch(a.nodeType){case 1:A(b,fa(Cb(a).toLowerCase()),"E",f);var h,j,n;g=a.attributes;for(var o=0,l=g&&g.length;o<l;o++)if(h=g[o],h.specified)j=h.name,n=fa(j.toLowerCase()),k[n]=j,c[n]=h=R(aa&&j=="href"?decodeURIComponent(a.getAttribute(j,2)):h.value),yb(a,n)&&(c[n]=!0),X(a,b,h,n),A(b,n,"A",f);a=a.className;if(F(a)&&a!=="")for(;g=e.exec(a);)n=fa(g[2]),A(b,n,"C",f)&&(c[n]=R(g[3])),a=a.substr(g.index+g[0].length);break;case 3:H(b,a.nodeValue);break;case 8:try{if(g=d.exec(a.nodeValue))n=fa(g[1]),A(b,
|
||||
n,"M",f)&&(c[n]=R(g[2]))}catch(r){}}b.sort(y);return b}function C(a,b,c,d,e){function f(a,b){if(a)a.require=z.require,l.push(a);if(b)b.require=z.require,ba.push(b)}function h(a,b){var c,d="data",e=!1;if(F(a)){for(;(c=a.charAt(0))=="^"||c=="?";)a=a.substr(1),c=="^"&&(d="inheritedData"),e=e||c=="?";c=b[d]("$"+a+"Controller");if(!c&&!e)throw B("No controller: "+a);}else J(a)&&(c=[],m(a,function(a){c.push(h(a,b))}));return c}function j(a,d,e,f,g){var n,q,w,K,s;n=b===e?c:hc(c,new ea(u(e),c.$attr));q=n.$$element;
|
||||
if(C){var zc=/^\s*([@=&])\s*(\w*)\s*$/,O=d.$parent||d;m(C.scope,function(a,b){var c=a.match(zc)||[],e=c[2]||b,f,g,k;switch(c[1]){case "@":n.$observe(e,function(a){d[b]=a});n.$$observers[e].$$scope=O;break;case "=":g=o(n[e]);k=g.assign||function(){f=d[b]=g(O);throw B(Db+n[e]+" (directive: "+C.name+")");};f=d[b]=g(O);d.$watch(function(){var a=g(O);a!==d[b]&&(a!==f?f=d[b]=a:k(O,a=f=d[b]));return a});break;case "&":g=o(n[e]);d[b]=function(a){return g(O,a)};break;default:throw B("Invalid isolate scope definition for directive "+
|
||||
C.name+": "+a);}})}t&&m(t,function(a){var b={$scope:d,$element:q,$attrs:n,$transclude:g};s=a.controller;s=="@"&&(s=n[a.name]);q.data("$"+a.name+"Controller",r(s,b))});f=0;for(w=l.length;f<w;f++)try{K=l[f],K(d,q,n,K.require&&h(K.require,q))}catch(y){k(y,pa(q))}a&&a(d,e.childNodes,p,g);f=0;for(w=ba.length;f<w;f++)try{K=ba[f],K(d,q,n,K.require&&h(K.require,q))}catch(Ha){k(Ha,pa(q))}}for(var n=-Number.MAX_VALUE,l=[],ba=[],s=null,C=null,A=null,y=c.$$element=u(b),z,H,X,D,v=d,t,x,Y,E=0,G=a.length;E<G;E++){z=
|
||||
a[E];X=p;if(n>z.priority)break;if(Y=z.scope)M("isolated scope",C,z,y),L(Y)&&(q(y,"ng-isolate-scope"),C=z),q(y,"ng-scope"),s=s||z;H=z.name;if(Y=z.controller)t=t||{},M("'"+H+"' controller",t[H],z,y),t[H]=z;if(Y=z.transclude)M("transclusion",D,z,y),D=z,n=z.priority,Y=="element"?(X=u(b),y=c.$$element=u("<\!-- "+H+": "+c[H]+" --\>"),b=y[0],Ga(e,u(X[0]),b),v=w(X,d,n)):(X=u(cb(b)).contents(),y.html(""),v=w(X,d));if(Y=z.template)if(M("template",A,z,y),A=z,Y=Ha(Y),z.replace){X=u("<div>"+R(Y)+"</div>").contents();
|
||||
b=X[0];if(X.length!=1||b.nodeType!==1)throw new B(g+Y);Ga(e,y,b);H={$attr:{}};a=a.concat(O(b,a.splice(E+1,a.length-(E+1)),H));K(c,H);G=a.length}else y.html(Y);if(z.templateUrl)M("template",A,z,y),A=z,j=W(a.splice(E,a.length-E),j,y,c,e,z.replace,v),G=a.length;else if(z.compile)try{x=z.compile(y,c,v),N(x)?f(null,x):x&&f(x.pre,x.post)}catch(I){k(I,pa(y))}if(z.terminal)j.terminal=!0,n=Math.max(n,z.priority)}j.scope=s&&s.scope;j.transclude=D&&v;return j}function A(d,e,g,h){var j=!1;if(a.hasOwnProperty(e))for(var n,
|
||||
e=b.get(e+c),o=0,l=e.length;o<l;o++)try{if(n=e[o],(h===p||h>n.priority)&&n.restrict.indexOf(g)!=-1)d.push(n),j=!0}catch(r){k(r)}return j}function K(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;m(a,function(d,e){e.charAt(0)!="$"&&(b[e]&&(d+=(e==="style"?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});m(b,function(b,f){f=="class"?(q(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):f=="style"?e.attr("style",e.attr("style")+";"+b):f.charAt(0)!="$"&&!a.hasOwnProperty(f)&&(a[f]=b,d[f]=c[f])})}function W(a,b,c,d,e,
|
||||
f,k){var h=[],n,o,r=c[0],q=a.shift(),w=x({},q,{controller:null,templateUrl:null,transclude:null,scope:null});c.html("");j.get(q.templateUrl,{cache:l}).success(function(j){var l,q,j=Ha(j);if(f){q=u("<div>"+R(j)+"</div>").contents();l=q[0];if(q.length!=1||l.nodeType!==1)throw new B(g+j);j={$attr:{}};Ga(e,c,l);O(l,a,j);K(d,j)}else l=r,c.html(j);a.unshift(w);n=C(a,c,d,k);for(o=s(c.contents(),k);h.length;){var ba=h.pop(),j=h.pop();q=h.pop();var y=h.pop(),m=l;q!==r&&(m=cb(l),Ga(j,u(q),m));n(function(){b(o,
|
||||
y,m,e,ba)},y,m,e,ba)}h=null}).error(function(a,b,c,d){throw B("Failed to load template: "+d.url);});return function(a,c,d,e,f){h?(h.push(c),h.push(d),h.push(e),h.push(f)):n(function(){b(o,c,d,e,f)},c,d,e,f)}}function y(a,b){return b.priority-a.priority}function M(a,b,c,d){if(b)throw B("Multiple directives ["+b.name+", "+c.name+"] asking for "+a+" on: "+pa(d));}function H(a,b){var c=h(b,!0);c&&a.push({priority:0,compile:I(function(a,b){var d=b.parent(),e=d.data("$binding")||[];e.push(c);q(d.data("$binding",
|
||||
e),"ng-binding");a.$watch(c,function(a){b[0].nodeValue=a})})})}function X(a,b,c,d){var e=h(c,!0);e&&b.push({priority:100,compile:I(function(a,b,c){b=c.$$observers||(c.$$observers={});d==="class"&&(e=h(c[d],!0));c[d]=p;(b[d]||(b[d]=[])).$$inter=!0;(c.$$observers&&c.$$observers[d].$$scope||a).$watch(e,function(a){c.$set(d,a)})})})}function Ga(a,b,c){var d=b[0],e=d.parentNode,f,g;if(a){f=0;for(g=a.length;f<g;f++)if(a[f]==d){a[f]=c;break}}e&&e.replaceChild(c,d);c[u.expando]=d[u.expando];b[0]=c}var ea=
|
||||
function(a,b){this.$$element=a;this.$attr=b||{}};ea.prototype={$normalize:fa,$set:function(a,b,c,d){var e=yb(this.$$element[0],a),f=this.$$observers;e&&(this.$$element.prop(a,b),d=e);this[a]=b;d?this.$attr[a]=d:(d=this.$attr[a])||(this.$attr[a]=d=$a(a,"-"));c!==!1&&(b===null||b===p?this.$$element.removeAttr(d):this.$$element.attr(d,b));f&&m(f[a],function(a){try{a(b)}catch(c){k(c)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers={}),e=d[a]||(d[a]=[]);e.push(b);n.$evalAsync(function(){e.$$inter||
|
||||
b(c[a])});return b}};var D=h.startSymbol(),ba=h.endSymbol(),Ha=D=="{{"||ba=="}}"?ma:function(a){return a.replace(/\{\{/g,D).replace(/}}/g,ba)};return w}]}function fa(b){return rb(b.replace(Ac,""))}function Bc(){var b={};this.register=function(a,c){L(a)?x(b,a):b[a]=c};this.$get=["$injector","$window",function(a,c){return function(d,e){if(F(d)){var g=d,d=b.hasOwnProperty(g)?b[g]:fb(e.$scope,g,!0)||fb(c,g,!0);ra(d,g,!0)}return a.instantiate(d,e)}}]}function Cc(){this.$get=["$window",function(b){return u(b.document)}]}
|
||||
function Dc(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,arguments)}}]}function Ec(){var b="{{",a="}}";this.startSymbol=function(a){return a?(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse",function(c){function d(d,f){for(var h,k,j=0,l=[],o=d.length,r=!1,n=[];j<o;)(h=d.indexOf(b,j))!=-1&&(k=d.indexOf(a,h+e))!=-1?(j!=h&&l.push(d.substring(j,h)),l.push(j=c(r=d.substring(h+e,k))),j.exp=r,j=k+g,r=!0):(j!=o&&l.push(d.substring(j)),j=o);if(!(o=
|
||||
l.length))l.push(""),o=1;if(!f||r)return n.length=o,j=function(a){for(var b=0,c=o,d;b<c;b++){if(typeof(d=l[b])=="function")d=d(a),d==null||d==p?d="":typeof d!="string"&&(d=da(d));n[b]=d}return n.join("")},j.exp=d,j.parts=l,j}var e=b.length,g=a.length;d.startSymbol=function(){return b};d.endSymbol=function(){return a};return d}]}function Eb(b){for(var b=b.split("/"),a=b.length;a--;)b[a]=Za(b[a]);return b.join("/")}function va(b,a){var c=Fb.exec(b),c={protocol:c[1],host:c[3],port:G(c[5])||Gb[c[1]]||
|
||||
null,path:c[6]||"/",search:c[8],hash:c[10]};if(a)a.$$protocol=c.protocol,a.$$host=c.host,a.$$port=c.port;return c}function ka(b,a,c){return b+"://"+a+(c==Gb[b]?"":":"+c)}function Fc(b,a,c){var d=va(b);return decodeURIComponent(d.path)!=a||t(d.hash)||d.hash.indexOf(c)!==0?b:ka(d.protocol,d.host,d.port)+a.substr(0,a.lastIndexOf("/"))+d.hash.substr(c.length)}function Gc(b,a,c){var d=va(b);if(decodeURIComponent(d.path)==a)return b;else{var e=d.search&&"?"+d.search||"",g=d.hash&&"#"+d.hash||"",i=a.substr(0,
|
||||
a.lastIndexOf("/")),f=d.path.substr(i.length);if(d.path.indexOf(i)!==0)throw B('Invalid url "'+b+'", missing path prefix "'+i+'" !');return ka(d.protocol,d.host,d.port)+a+"#"+c+f+e+g}}function gb(b,a,c){a=a||"";this.$$parse=function(b){var c=va(b,this);if(c.path.indexOf(a)!==0)throw B('Invalid url "'+b+'", missing path prefix "'+a+'" !');this.$$path=decodeURIComponent(c.path.substr(a.length));this.$$search=Xa(c.search);this.$$hash=c.hash&&decodeURIComponent(c.hash)||"";this.$$compose()};this.$$compose=
|
||||
function(){var b=ob(this.$$search),c=this.$$hash?"#"+Za(this.$$hash):"";this.$$url=Eb(this.$$path)+(b?"?"+b:"")+c;this.$$absUrl=ka(this.$$protocol,this.$$host,this.$$port)+a+this.$$url};this.$$rewriteAppUrl=function(a){if(a.indexOf(c)==0)return a};this.$$parse(b)}function Ia(b,a,c){var d;this.$$parse=function(b){var c=va(b,this);if(c.hash&&c.hash.indexOf(a)!==0)throw B('Invalid url "'+b+'", missing hash prefix "'+a+'" !');d=c.path+(c.search?"?"+c.search:"");c=Hc.exec((c.hash||"").substr(a.length));
|
||||
this.$$path=c[1]?(c[1].charAt(0)=="/"?"":"/")+decodeURIComponent(c[1]):"";this.$$search=Xa(c[3]);this.$$hash=c[5]&&decodeURIComponent(c[5])||"";this.$$compose()};this.$$compose=function(){var b=ob(this.$$search),c=this.$$hash?"#"+Za(this.$$hash):"";this.$$url=Eb(this.$$path)+(b?"?"+b:"")+c;this.$$absUrl=ka(this.$$protocol,this.$$host,this.$$port)+d+(this.$$url?"#"+a+this.$$url:"")};this.$$rewriteAppUrl=function(a){if(a.indexOf(c)==0)return a};this.$$parse(b)}function Hb(b,a,c,d){Ia.apply(this,arguments);
|
||||
this.$$rewriteAppUrl=function(b){if(b.indexOf(c)==0)return c+d+"#"+a+b.substr(c.length)}}function Ja(b){return function(){return this[b]}}function Ib(b,a){return function(c){if(t(c))return this[b];this[b]=a(c);this.$$compose();return this}}function Ic(){var b="",a=!1;this.hashPrefix=function(a){return v(a)?(b=a,this):b};this.html5Mode=function(b){return v(b)?(a=b,this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(c,d,e,g){function i(a){c.$broadcast("$locationChangeSuccess",
|
||||
f.absUrl(),a)}var f,h,k,j=d.url(),l=va(j);a?(h=d.baseHref()||"/",k=h.substr(0,h.lastIndexOf("/")),l=ka(l.protocol,l.host,l.port)+k+"/",f=e.history?new gb(Fc(j,h,b),k,l):new Hb(Gc(j,h,b),b,l,h.substr(k.length+1))):(l=ka(l.protocol,l.host,l.port)+(l.path||"")+(l.search?"?"+l.search:"")+"#"+b+"/",f=new Ia(j,b,l));g.bind("click",function(a){if(!a.ctrlKey&&!(a.metaKey||a.which==2)){for(var b=u(a.target);E(b[0].nodeName)!=="a";)if(b[0]===g[0]||!(b=b.parent())[0])return;var d=b.prop("href"),e=f.$$rewriteAppUrl(d);
|
||||
d&&!b.attr("target")&&e&&(f.$$parse(e),c.$apply(),a.preventDefault(),U.angular["ff-684208-preventDefault"]=!0)}});f.absUrl()!=j&&d.url(f.absUrl(),!0);d.onUrlChange(function(a){f.absUrl()!=a&&(c.$evalAsync(function(){var b=f.absUrl();f.$$parse(a);i(b)}),c.$$phase||c.$digest())});var o=0;c.$watch(function(){var a=d.url(),b=f.$$replace;if(!o||a!=f.absUrl())o++,c.$evalAsync(function(){c.$broadcast("$locationChangeStart",f.absUrl(),a).defaultPrevented?f.$$parse(a):(d.url(f.absUrl(),b),i(a))});f.$$replace=
|
||||
!1;return o});return f}]}function Jc(){this.$get=["$window",function(b){function a(a){a instanceof B&&(a.stack?a=a.message&&a.stack.indexOf(a.message)===-1?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function c(c){var e=b.console||{},g=e[c]||e.log||D;return g.apply?function(){var b=[];m(arguments,function(c){b.push(a(c))});return g.apply(e,b)}:function(a,b){g(a,b)}}return{log:c("log"),warn:c("warn"),info:c("info"),error:c("error")}}]}function Kc(b,
|
||||
a){function c(a){return a.indexOf(q)!=-1}function d(){return n+1<b.length?b.charAt(n+1):!1}function e(a){return"0"<=a&&a<="9"}function g(a){return a==" "||a=="\r"||a=="\t"||a=="\n"||a=="\u000b"||a=="\u00a0"}function i(a){return"a"<=a&&a<="z"||"A"<=a&&a<="Z"||"_"==a||a=="$"}function f(a){return a=="-"||a=="+"||e(a)}function h(a,c,d){d=d||n;throw B("Lexer Error: "+a+" at column"+(v(c)?"s "+c+"-"+n+" ["+b.substring(c,d)+"]":" "+d)+" in expression ["+b+"].");}function k(){for(var a="",c=n;n<b.length;){var k=
|
||||
E(b.charAt(n));if(k=="."||e(k))a+=k;else{var g=d();if(k=="e"&&f(g))a+=k;else if(f(k)&&g&&e(g)&&a.charAt(a.length-1)=="e")a+=k;else if(f(k)&&(!g||!e(g))&&a.charAt(a.length-1)=="e")h("Invalid exponent");else break}n++}a*=1;o.push({index:c,text:a,json:!0,fn:function(){return a}})}function j(){for(var c="",d=n,f,k,h;n<b.length;){var j=b.charAt(n);if(j=="."||i(j)||e(j))j=="."&&(f=n),c+=j;else break;n++}if(f)for(k=n;k<b.length;){j=b.charAt(k);if(j=="("){h=c.substr(f-d+1);c=c.substr(0,f-d);n=k;break}if(g(j))k++;
|
||||
else break}d={index:d,text:c};if(Ka.hasOwnProperty(c))d.fn=d.json=Ka[c];else{var l=Jb(c,a);d.fn=x(function(a,b){return l(a,b)},{assign:function(a,b){return Kb(a,c,b)}})}o.push(d);h&&(o.push({index:f,text:".",json:!1}),o.push({index:f+1,text:h,json:!1}))}function l(a){var c=n;n++;for(var d="",e=a,f=!1;n<b.length;){var k=b.charAt(n);e+=k;if(f)k=="u"?(k=b.substring(n+1,n+5),k.match(/[\da-f]{4}/i)||h("Invalid unicode escape [\\u"+k+"]"),n+=4,d+=String.fromCharCode(parseInt(k,16))):(f=Lc[k],d+=f?f:k),
|
||||
f=!1;else if(k=="\\")f=!0;else if(k==a){n++;o.push({index:c,text:e,string:d,json:!0,fn:function(){return d}});return}else d+=k;n++}h("Unterminated quote",c)}for(var o=[],r,n=0,w=[],q,s=":";n<b.length;){q=b.charAt(n);if(c("\"'"))l(q);else if(e(q)||c(".")&&e(d()))k();else if(i(q)){if(j(),"{,".indexOf(s)!=-1&&w[0]=="{"&&(r=o[o.length-1]))r.json=r.text.indexOf(".")==-1}else if(c("(){}[].,;:"))o.push({index:n,text:q,json:":[,".indexOf(s)!=-1&&c("{[")||c("}]:,")}),c("{[")&&w.unshift(q),c("}]")&&w.shift(),
|
||||
n++;else if(g(q)){n++;continue}else{var m=q+d(),C=Ka[q],A=Ka[m];A?(o.push({index:n,text:m,fn:A}),n+=2):C?(o.push({index:n,text:q,fn:C,json:"[,:".indexOf(s)!=-1&&c("+-")}),n+=1):h("Unexpected next character ",n,n+1)}s=q}return o}function Mc(b,a,c,d){function e(a,c){throw B("Syntax Error: Token '"+c.text+"' "+a+" at column "+(c.index+1)+" of the expression ["+b+"] starting at ["+b.substring(c.index)+"].");}function g(){if(M.length===0)throw B("Unexpected end of expression: "+b);return M[0]}function i(a,
|
||||
b,c,d){if(M.length>0){var e=M[0],f=e.text;if(f==a||f==b||f==c||f==d||!a&&!b&&!c&&!d)return e}return!1}function f(b,c,d,f){return(b=i(b,c,d,f))?(a&&!b.json&&e("is not valid json",b),M.shift(),b):!1}function h(a){f(a)||e("is unexpected, expecting ["+a+"]",i())}function k(a,b){return function(c,d){return a(c,d,b)}}function j(a,b,c){return function(d,e){return b(d,e,a,c)}}function l(){for(var a=[];;)if(M.length>0&&!i("}",")",";","]")&&a.push(v()),!f(";"))return a.length==1?a[0]:function(b,c){for(var d,
|
||||
e=0;e<a.length;e++){var f=a[e];f&&(d=f(b,c))}return d}}function o(){for(var a=f(),b=c(a.text),d=[];;)if(a=f(":"))d.push(H());else{var e=function(a,c,e){for(var e=[e],f=0;f<d.length;f++)e.push(d[f](a,c));return b.apply(a,e)};return function(){return e}}}function r(){for(var a=n(),b;;)if(b=f("||"))a=j(a,b.fn,n());else return a}function n(){var a=w(),b;if(b=f("&&"))a=j(a,b.fn,n());return a}function w(){var a=q(),b;if(b=f("==","!="))a=j(a,b.fn,w());return a}function q(){var a;a=s();for(var b;b=f("+",
|
||||
"-");)a=j(a,b.fn,s());if(b=f("<",">","<=",">="))a=j(a,b.fn,q());return a}function s(){for(var a=m(),b;b=f("*","/","%");)a=j(a,b.fn,m());return a}function m(){var a;return f("+")?C():(a=f("-"))?j(W,a.fn,m()):(a=f("!"))?k(a.fn,m()):C()}function C(){var a;if(f("("))a=v(),h(")");else if(f("["))a=A();else if(f("{"))a=K();else{var b=f();(a=b.fn)||e("not a primary expression",b)}for(var c;b=f("(","[",".");)b.text==="("?(a=u(a,c),c=null):b.text==="["?(c=a,a=ea(a)):b.text==="."?(c=a,a=t(a)):e("IMPOSSIBLE");
|
||||
return a}function A(){var a=[];if(g().text!="]"){do a.push(H());while(f(","))}h("]");return function(b,c){for(var d=[],e=0;e<a.length;e++)d.push(a[e](b,c));return d}}function K(){var a=[];if(g().text!="}"){do{var b=f(),b=b.string||b.text;h(":");var c=H();a.push({key:b,value:c})}while(f(","))}h("}");return function(b,c){for(var d={},e=0;e<a.length;e++){var f=a[e],k=f.value(b,c);d[f.key]=k}return d}}var W=I(0),y,M=Kc(b,d),H=function(){var a=r(),c,d;return(d=f("="))?(a.assign||e("implies assignment but ["+
|
||||
b.substring(0,d.index)+"] can not be assigned to",d),c=r(),function(b,d){return a.assign(b,c(b,d),d)}):a},u=function(a,b){var c=[];if(g().text!=")"){do c.push(H());while(f(","))}h(")");return function(d,e){for(var f=[],k=b?b(d,e):d,h=0;h<c.length;h++)f.push(c[h](d,e));h=a(d,e)||D;return h.apply?h.apply(k,f):h(f[0],f[1],f[2],f[3],f[4])}},t=function(a){var b=f().text,c=Jb(b,d);return x(function(b,d){return c(a(b,d),d)},{assign:function(c,d,e){return Kb(a(c,e),b,d)}})},ea=function(a){var b=H();h("]");
|
||||
return x(function(c,d){var e=a(c,d),f=b(c,d),k;if(!e)return p;if((e=e[f])&&e.then){k=e;if(!("$$v"in e))k.$$v=p,k.then(function(a){k.$$v=a});e=e.$$v}return e},{assign:function(c,d,e){return a(c,e)[b(c,e)]=d}})},v=function(){for(var a=H(),b;;)if(b=f("|"))a=j(a,b.fn,o());else return a};a?(H=r,u=t=ea=v=function(){e("is not valid json",{text:b,index:0})},y=C()):y=l();M.length!==0&&e("is an unexpected token",M[0]);return y}function Kb(b,a,c){for(var a=a.split("."),d=0;a.length>1;d++){var e=a.shift(),g=
|
||||
b[e];g||(g={},b[e]=g);b=g}return b[a.shift()]=c}function fb(b,a,c){if(!a)return b;for(var a=a.split("."),d,e=b,g=a.length,i=0;i<g;i++)d=a[i],b&&(b=(e=b)[d]);return!c&&N(b)?Va(e,b):b}function Lb(b,a,c,d,e){return function(g,i){var f=i&&i.hasOwnProperty(b)?i:g,h;if(f===null||f===p)return f;if((f=f[b])&&f.then){if(!("$$v"in f))h=f,h.$$v=p,h.then(function(a){h.$$v=a});f=f.$$v}if(!a||f===null||f===p)return f;if((f=f[a])&&f.then){if(!("$$v"in f))h=f,h.$$v=p,h.then(function(a){h.$$v=a});f=f.$$v}if(!c||f===
|
||||
null||f===p)return f;if((f=f[c])&&f.then){if(!("$$v"in f))h=f,h.$$v=p,h.then(function(a){h.$$v=a});f=f.$$v}if(!d||f===null||f===p)return f;if((f=f[d])&&f.then){if(!("$$v"in f))h=f,h.$$v=p,h.then(function(a){h.$$v=a});f=f.$$v}if(!e||f===null||f===p)return f;if((f=f[e])&&f.then){if(!("$$v"in f))h=f,h.$$v=p,h.then(function(a){h.$$v=a});f=f.$$v}return f}}function Jb(b,a){if(hb.hasOwnProperty(b))return hb[b];var c=b.split("."),d=c.length,e;if(a)e=d<6?Lb(c[0],c[1],c[2],c[3],c[4]):function(a,b){var e=0,
|
||||
k;do k=Lb(c[e++],c[e++],c[e++],c[e++],c[e++])(a,b),b=p,a=k;while(e<d);return k};else{var g="var l, fn, p;\n";m(c,function(a,b){g+="if(s === null || s === undefined) return s;\nl=s;\ns="+(b?"s":'((k&&k.hasOwnProperty("'+a+'"))?k:s)')+'["'+a+'"];\nif (s && s.then) {\n if (!("$$v" in s)) {\n p=s;\n p.$$v = undefined;\n p.then(function(v) {p.$$v=v;});\n}\n s=s.$$v\n}\n'});g+="return s;";e=Function("s","k",g);e.toString=function(){return g}}return hb[b]=e}function Nc(){var b={};this.$get=["$filter","$sniffer",
|
||||
function(a,c){return function(d){switch(typeof d){case "string":return b.hasOwnProperty(d)?b[d]:b[d]=Mc(d,!1,a,c.csp);case "function":return d;default:return D}}}]}function Oc(){this.$get=["$rootScope","$exceptionHandler",function(b,a){return Pc(function(a){b.$evalAsync(a)},a)}]}function Pc(b,a){function c(a){return a}function d(a){return i(a)}var e=function(){var f=[],h,k;return k={resolve:function(a){if(f){var c=f;f=p;h=g(a);c.length&&b(function(){for(var a,b=0,d=c.length;b<d;b++)a=c[b],h.then(a[0],
|
||||
a[1])})}},reject:function(a){k.resolve(i(a))},promise:{then:function(b,k){var g=e(),i=function(d){try{g.resolve((b||c)(d))}catch(e){a(e),g.reject(e)}},n=function(b){try{g.resolve((k||d)(b))}catch(c){a(c),g.reject(c)}};f?f.push([i,n]):h.then(i,n);return g.promise}}}},g=function(a){return a&&a.then?a:{then:function(c){var d=e();b(function(){d.resolve(c(a))});return d.promise}}},i=function(a){return{then:function(c,k){var g=e();b(function(){g.resolve((k||d)(a))});return g.promise}}};return{defer:e,reject:i,
|
||||
when:function(f,h,k){var j=e(),l,o=function(b){try{return(h||c)(b)}catch(d){return a(d),i(d)}},r=function(b){try{return(k||d)(b)}catch(c){return a(c),i(c)}};b(function(){g(f).then(function(a){l||(l=!0,j.resolve(g(a).then(o,r)))},function(a){l||(l=!0,j.resolve(r(a)))})});return j.promise},all:function(a){var b=e(),c=a.length,d=[];c?m(a,function(a,e){g(a).then(function(a){e in d||(d[e]=a,--c||b.resolve(d))},function(a){e in d||b.reject(a)})}):b.resolve(d);return b.promise}}}function Qc(){var b={};this.when=
|
||||
function(a,c){b[a]=x({reloadOnSearch:!0},c);if(a){var d=a[a.length-1]=="/"?a.substr(0,a.length-1):a+"/";b[d]={redirectTo:a}}return this};this.otherwise=function(a){this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache",function(a,c,d,e,g,i,f){function h(){var b=k(),h=r.current;if(b&&h&&b.$route===h.$route&&ha(b.pathParams,h.pathParams)&&!b.reloadOnSearch&&!o)h.params=b.params,V(h.params,d),a.$broadcast("$routeUpdate",h);else if(b||
|
||||
h)o=!1,a.$broadcast("$routeChangeStart",b,h),(r.current=b)&&b.redirectTo&&(F(b.redirectTo)?c.path(j(b.redirectTo,b.params)).search(b.params).replace():c.url(b.redirectTo(b.pathParams,c.path(),c.search())).replace()),e.when(b).then(function(){if(b){var a=[],c=[],d;m(b.resolve||{},function(b,d){a.push(d);c.push(F(b)?g.get(b):g.invoke(b))});if(!v(d=b.template))if(v(d=b.templateUrl))d=i.get(d,{cache:f}).then(function(a){return a.data});v(d)&&(a.push("$template"),c.push(d));return e.all(c).then(function(b){var c=
|
||||
{};m(b,function(b,d){c[a[d]]=b});return c})}}).then(function(c){if(b==r.current){if(b)b.locals=c,V(b.params,d);a.$broadcast("$routeChangeSuccess",b,h)}},function(c){b==r.current&&a.$broadcast("$routeChangeError",b,h,c)})}function k(){var a,d;m(b,function(b,e){if(!d&&(a=l(c.path(),e)))d=ya(b,{params:x({},c.search(),a),pathParams:a}),d.$route=b});return d||b[null]&&ya(b[null],{params:{},pathParams:{}})}function j(a,b){var c=[];m((a||"").split(":"),function(a,d){if(d==0)c.push(a);else{var e=a.match(/(\w+)(.*)/),
|
||||
f=e[1];c.push(b[f]);c.push(e[2]||"");delete b[f]}});return c.join("")}var l=function(a,b){var c="^"+b.replace(/([\.\\\(\)\^\$])/g,"\\$1")+"$",d=[],e={};m(b.split(/\W/),function(a){if(a){var b=RegExp(":"+a+"([\\W])");c.match(b)&&(c=c.replace(b,"([^\\/]*)$1"),d.push(a))}});var f=a.match(RegExp(c));f&&m(d,function(a,b){e[a]=f[b+1]});return f?e:null},o=!1,r={routes:b,reload:function(){o=!0;a.$evalAsync(h)}};a.$on("$locationChangeSuccess",h);return r}]}function Rc(){this.$get=I({})}function Sc(){var b=
|
||||
10;this.digestTtl=function(a){arguments.length&&(b=a);return b};this.$get=["$injector","$exceptionHandler","$parse",function(a,c,d){function e(){this.$id=xa();this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this["this"]=this.$root=this;this.$$asyncQueue=[];this.$$listeners={}}function g(a){if(h.$$phase)throw B(h.$$phase+" already in progress");h.$$phase=a}function i(a,b){var c=d(a);ra(c,b);return c}function f(){}e.prototype={$new:function(a){if(N(a))throw B("API-CHANGE: Use $controller to instantiate controllers.");
|
||||
a?(a=new e,a.$root=this.$root):(a=function(){},a.prototype=this,a=new a,a.$id=xa());a["this"]=a;a.$$listeners={};a.$parent=this;a.$$asyncQueue=[];a.$$watchers=a.$$nextSibling=a.$$childHead=a.$$childTail=null;a.$$prevSibling=this.$$childTail;this.$$childHead?this.$$childTail=this.$$childTail.$$nextSibling=a:this.$$childHead=this.$$childTail=a;return a},$watch:function(a,b,c){var d=i(a,"watch"),e=this.$$watchers,g={fn:b,last:f,get:d,exp:a,eq:!!c};if(!N(b)){var h=i(b||D,"listener");g.fn=function(a,b,
|
||||
c){h(c)}}if(!e)e=this.$$watchers=[];e.unshift(g);return function(){Ua(e,g)}},$digest:function(){var a,d,e,i,r,n,m,q=b,s,p=[],C,A;g("$digest");do{m=!1;s=this;do{for(r=s.$$asyncQueue;r.length;)try{s.$eval(r.shift())}catch(K){c(K)}if(i=s.$$watchers)for(n=i.length;n--;)try{if(a=i[n],(d=a.get(s))!==(e=a.last)&&!(a.eq?ha(d,e):typeof d=="number"&&typeof e=="number"&&isNaN(d)&&isNaN(e)))m=!0,a.last=a.eq?V(d):d,a.fn(d,e===f?d:e,s),q<5&&(C=4-q,p[C]||(p[C]=[]),A=N(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):
|
||||
a.exp,A+="; newVal: "+da(d)+"; oldVal: "+da(e),p[C].push(A))}catch(W){c(W)}if(!(i=s.$$childHead||s!==this&&s.$$nextSibling))for(;s!==this&&!(i=s.$$nextSibling);)s=s.$parent}while(s=i);if(m&&!q--)throw h.$$phase=null,B(b+" $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: "+da(p));}while(m||r.length);h.$$phase=null},$destroy:function(){if(h!=this){var a=this.$parent;this.$broadcast("$destroy");if(a.$$childHead==this)a.$$childHead=this.$$nextSibling;if(a.$$childTail==
|
||||
this)a.$$childTail=this.$$prevSibling;if(this.$$prevSibling)this.$$prevSibling.$$nextSibling=this.$$nextSibling;if(this.$$nextSibling)this.$$nextSibling.$$prevSibling=this.$$prevSibling;this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null}},$eval:function(a,b){return d(a)(this,b)},$evalAsync:function(a){this.$$asyncQueue.push(a)},$apply:function(a){try{return g("$apply"),this.$eval(a)}catch(b){c(b)}finally{h.$$phase=null;try{h.$digest()}catch(d){throw c(d),d;}}},
|
||||
$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);return function(){c[za(c,b)]=null}},$emit:function(a,b){var d=[],e,f=this,g=!1,h={name:a,targetScope:f,stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},i=[h].concat(ia.call(arguments,1)),m,p;do{e=f.$$listeners[a]||d;h.currentScope=f;m=0;for(p=e.length;m<p;m++)if(e[m])try{if(e[m].apply(null,i),g)return h}catch(C){c(C)}else e.splice(m,1),m--,p--;f=f.$parent}while(f);
|
||||
return h},$broadcast:function(a,b){var d=this,e=this,f={name:a,targetScope:this,preventDefault:function(){f.defaultPrevented=!0},defaultPrevented:!1},g=[f].concat(ia.call(arguments,1)),h,i;do{d=e;f.currentScope=d;e=d.$$listeners[a]||[];h=0;for(i=e.length;h<i;h++)if(e[h])try{e[h].apply(null,g)}catch(m){c(m)}else e.splice(h,1),h--,i--;if(!(e=d.$$childHead||d!==this&&d.$$nextSibling))for(;d!==this&&!(e=d.$$nextSibling);)d=d.$parent}while(d=e);return f}};var h=new e;return h}]}function Tc(){this.$get=
|
||||
["$window",function(b){var a={},c=G((/android (\d+)/.exec(E(b.navigator.userAgent))||[])[1]);return{history:!(!b.history||!b.history.pushState||c<4),hashchange:"onhashchange"in b&&(!b.document.documentMode||b.document.documentMode>7),hasEvent:function(c){if(c=="input"&&aa==9)return!1;if(t(a[c])){var e=b.document.createElement("div");a[c]="on"+c in e}return a[c]},csp:!1}}]}function Uc(){this.$get=I(U)}function Mb(b){var a={},c,d,e;if(!b)return a;m(b.split("\n"),function(b){e=b.indexOf(":");c=E(R(b.substr(0,
|
||||
e)));d=R(b.substr(e+1));c&&(a[c]?a[c]+=", "+d:a[c]=d)});return a}function Nb(b){var a=L(b)?b:p;return function(c){a||(a=Mb(b));return c?a[E(c)]||null:a}}function Ob(b,a,c){if(N(c))return c(b,a);m(c,function(c){b=c(b,a)});return b}function Vc(){var b=/^\s*(\[|\{[^\{])/,a=/[\}\]]\s*$/,c=/^\)\]\}',?\n/,d=this.defaults={transformResponse:[function(d){F(d)&&(d=d.replace(c,""),b.test(d)&&a.test(d)&&(d=nb(d,!0)));return d}],transformRequest:[function(a){return L(a)&&Sa.apply(a)!=="[object File]"?da(a):a}],
|
||||
headers:{common:{Accept:"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest"},post:{"Content-Type":"application/json;charset=utf-8"},put:{"Content-Type":"application/json;charset=utf-8"}}},e=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,b,c,h,k,j){function l(a){function c(a){var b=x({},a,{data:Ob(a.data,a.headers,f)});return 200<=a.status&&a.status<300?b:k.reject(b)}a.method=la(a.method);var e=a.transformRequest||
|
||||
d.transformRequest,f=a.transformResponse||d.transformResponse,h=d.headers,h=x({"X-XSRF-TOKEN":b.cookies()["XSRF-TOKEN"]},h.common,h[E(a.method)],a.headers),e=Ob(a.data,Nb(h),e),g;t(a.data)&&delete h["Content-Type"];g=o(a,e,h);g=g.then(c,c);m(w,function(a){g=a(g)});g.success=function(b){g.then(function(c){b(c.data,c.status,c.headers,a)});return g};g.error=function(b){g.then(null,function(c){b(c.data,c.status,c.headers,a)});return g};return g}function o(b,c,d){function e(a,b,c){m&&(200<=a&&a<300?m.put(w,
|
||||
[a,b,Mb(c)]):m.remove(w));f(b,a,c);h.$apply()}function f(a,c,d){c=Math.max(c,0);(200<=c&&c<300?j.resolve:j.reject)({data:a,status:c,headers:Nb(d),config:b})}function i(){var a=za(l.pendingRequests,b);a!==-1&&l.pendingRequests.splice(a,1)}var j=k.defer(),o=j.promise,m,p,w=r(b.url,b.params);l.pendingRequests.push(b);o.then(i,i);b.cache&&b.method=="GET"&&(m=L(b.cache)?b.cache:n);if(m)if(p=m.get(w))if(p.then)return p.then(i,i),p;else J(p)?f(p[1],p[0],V(p[2])):f(p,200,{});else m.put(w,o);p||a(b.method,
|
||||
w,c,e,d,b.timeout,b.withCredentials);return o}function r(a,b){if(!b)return a;var c=[];ec(b,function(a,b){a==null||a==p||(L(a)&&(a=da(a)),c.push(encodeURIComponent(b)+"="+encodeURIComponent(a)))});return a+(a.indexOf("?")==-1?"?":"&")+c.join("&")}var n=c("$http"),w=[];m(e,function(a){w.push(F(a)?j.get(a):j.invoke(a))});l.pendingRequests=[];(function(a){m(arguments,function(a){l[a]=function(b,c){return l(x(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){m(arguments,function(a){l[a]=
|
||||
function(b,c,d){return l(x(d||{},{method:a,url:b,data:c}))}})})("post","put");l.defaults=d;return l}]}function Wc(){this.$get=["$browser","$window","$document",function(b,a,c){return Xc(b,Yc,b.defer,a.angular.callbacks,c[0],a.location.protocol.replace(":",""))}]}function Xc(b,a,c,d,e,g){function i(a,b){var c=e.createElement("script"),d=function(){e.body.removeChild(c);b&&b()};c.type="text/javascript";c.src=a;aa?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&d()}:c.onload=c.onerror=
|
||||
d;e.body.appendChild(c)}return function(e,h,k,j,l,o,r){function n(a,c,d,e){c=(h.match(Fb)||["",g])[1]=="file"?d?200:404:c;a(c==1223?204:c,d,e);b.$$completeOutstandingRequest(D)}b.$$incOutstandingRequestCount();h=h||b.url();if(E(e)=="jsonp"){var p="_"+(d.counter++).toString(36);d[p]=function(a){d[p].data=a};i(h.replace("JSON_CALLBACK","angular.callbacks."+p),function(){d[p].data?n(j,200,d[p].data):n(j,-2);delete d[p]})}else{var q=new a;q.open(e,h,!0);m(l,function(a,b){a&&q.setRequestHeader(b,a)});
|
||||
var s;q.onreadystatechange=function(){q.readyState==4&&n(j,s||q.status,q.responseText,q.getAllResponseHeaders())};if(r)q.withCredentials=!0;q.send(k||"");o>0&&c(function(){s=-1;q.abort()},o)}}}function Zc(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},
|
||||
DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",
|
||||
shortTime:"h:mm a"},pluralCat:function(b){return b===1?"one":"other"}}}}function $c(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(b,a,c,d){function e(e,f,h){var k=c.defer(),j=k.promise,l=v(h)&&!h,f=a.defer(function(){try{k.resolve(e())}catch(a){k.reject(a),d(a)}l||b.$apply()},f),h=function(){delete g[j.$$timeoutId]};j.$$timeoutId=f;g[f]=k;j.then(h,h);return j}var g={};e.cancel=function(b){return b&&b.$$timeoutId in g?(g[b.$$timeoutId].reject("canceled"),a.defer.cancel(b.$$timeoutId)):
|
||||
!1};return e}]}function Pb(b){function a(a,e){return b.factory(a+c,e)}var c="Filter";this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}];a("currency",Qb);a("date",Rb);a("filter",ad);a("json",bd);a("limitTo",cd);a("lowercase",dd);a("number",Sb);a("orderBy",Tb);a("uppercase",ed)}function ad(){return function(b,a){if(!(b instanceof Array))return b;var c=[];c.check=function(a){for(var b=0;b<c.length;b++)if(!c[b](a))return!1;return!0};var d=function(a,b){if(b.charAt(0)===
|
||||
"!")return!d(a,b.substr(1));switch(typeof a){case "boolean":case "number":case "string":return(""+a).toLowerCase().indexOf(b)>-1;case "object":for(var c in a)if(c.charAt(0)!=="$"&&d(a[c],b))return!0;return!1;case "array":for(c=0;c<a.length;c++)if(d(a[c],b))return!0;return!1;default:return!1}};switch(typeof a){case "boolean":case "number":case "string":a={$:a};case "object":for(var e in a)e=="$"?function(){var b=(""+a[e]).toLowerCase();b&&c.push(function(a){return d(a,b)})}():function(){var b=e,f=
|
||||
(""+a[e]).toLowerCase();f&&c.push(function(a){return d(fb(a,b),f)})}();break;case "function":c.push(a);break;default:return b}for(var g=[],i=0;i<b.length;i++){var f=b[i];c.check(f)&&g.push(f)}return g}}function Qb(b){var a=b.NUMBER_FORMATS;return function(b,d){if(t(d))d=a.CURRENCY_SYM;return Ub(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,2).replace(/\u00A4/g,d)}}function Sb(b){var a=b.NUMBER_FORMATS;return function(b,d){return Ub(b,a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function Ub(b,a,c,d,e){if(isNaN(b)||
|
||||
!isFinite(b))return"";var g=b<0,b=Math.abs(b),i=b+"",f="",h=[],k=!1;if(i.indexOf("e")!==-1){var j=i.match(/([\d\.]+)e(-?)(\d+)/);j&&j[2]=="-"&&j[3]>e+1?i="0":(f=i,k=!0)}if(!k){i=(i.split(Vb)[1]||"").length;t(e)&&(e=Math.min(Math.max(a.minFrac,i),a.maxFrac));var i=Math.pow(10,e),b=Math.round(b*i)/i,b=(""+b).split(Vb),i=b[0],b=b[1]||"",k=0,j=a.lgSize,l=a.gSize;if(i.length>=j+l)for(var k=i.length-j,o=0;o<k;o++)(k-o)%l===0&&o!==0&&(f+=c),f+=i.charAt(o);for(o=k;o<i.length;o++)(i.length-o)%j===0&&o!==0&&
|
||||
(f+=c),f+=i.charAt(o);for(;b.length<e;)b+="0";e&&(f+=d+b.substr(0,e))}h.push(g?a.negPre:a.posPre);h.push(f);h.push(g?a.negSuf:a.posSuf);return h.join("")}function ib(b,a,c){var d="";b<0&&(d="-",b=-b);for(b=""+b;b.length<a;)b="0"+b;c&&(b=b.substr(b.length-a));return d+b}function P(b,a,c,d){return function(e){e=e["get"+b]();if(c>0||e>-c)e+=c;e===0&&c==-12&&(e=12);return ib(e,a,d)}}function La(b,a){return function(c,d){var e=c["get"+b](),g=la(a?"SHORT"+b:b);return d[g][e]}}function Rb(b){function a(a){var b;
|
||||
if(b=a.match(c)){var a=new Date(0),g=0,i=0;b[9]&&(g=G(b[9]+b[10]),i=G(b[9]+b[11]));a.setUTCFullYear(G(b[1]),G(b[2])-1,G(b[3]));a.setUTCHours(G(b[4]||0)-g,G(b[5]||0)-i,G(b[6]||0),G(b[7]||0))}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var g="",i=[],f,h,e=e||"mediumDate",e=b.DATETIME_FORMATS[e]||e;F(c)&&(c=fd.test(c)?G(c):a(c));wa(c)&&(c=new Date(c));if(!na(c))return c;for(;e;)(h=gd.exec(e))?(i=i.concat(ia.call(h,
|
||||
1)),e=i.pop()):(i.push(e),e=null);m(i,function(a){f=hd[a];g+=f?f(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function bd(){return function(b){return da(b,!0)}}function cd(){return function(b,a){if(!(b instanceof Array))return b;var a=G(a),c=[],d,e;if(!b||!(b instanceof Array))return c;a>b.length?a=b.length:a<-b.length&&(a=-b.length);a>0?(d=0,e=a):(d=b.length+a,e=b.length);for(;d<e;d++)c.push(b[d]);return c}}function Tb(b){return function(a,c,d){function e(a,b){return Wa(b)?
|
||||
function(b,c){return a(c,b)}:a}if(!(a instanceof Array))return a;if(!c)return a;for(var c=J(c)?c:[c],c=Ta(c,function(a){var c=!1,d=a||ma;if(F(a)){if(a.charAt(0)=="+"||a.charAt(0)=="-")c=a.charAt(0)=="-",a=a.substring(1);d=b(a)}return e(function(a,b){var c;c=d(a);var e=d(b),f=typeof c,g=typeof e;f==g?(f=="string"&&(c=c.toLowerCase()),f=="string"&&(e=e.toLowerCase()),c=c===e?0:c<e?-1:1):c=f<g?-1:1;return c},c)}),g=[],i=0;i<a.length;i++)g.push(a[i]);return g.sort(e(function(a,b){for(var d=0;d<c.length;d++){var e=
|
||||
c[d](a,b);if(e!==0)return e}return 0},d))}}function S(b){N(b)&&(b={link:b});b.restrict=b.restrict||"AC";return I(b)}function Wb(b,a){function c(a,c){c=c?"-"+$a(c,"-"):"";b.removeClass((a?Ma:Na)+c).addClass((a?Na:Ma)+c)}var d=this,e=b.parent().controller("form")||Oa,g=0,i=d.$error={};d.$name=a.name;d.$dirty=!1;d.$pristine=!0;d.$valid=!0;d.$invalid=!1;e.$addControl(d);b.addClass(Pa);c(!0);d.$addControl=function(a){a.$name&&!d.hasOwnProperty(a.$name)&&(d[a.$name]=a)};d.$removeControl=function(a){a.$name&&
|
||||
d[a.$name]===a&&delete d[a.$name];m(i,function(b,c){d.$setValidity(c,!0,a)})};d.$setValidity=function(a,b,k){var j=i[a];if(b){if(j&&(Ua(j,k),!j.length)){g--;if(!g)c(b),d.$valid=!0,d.$invalid=!1;i[a]=!1;c(!0,a);e.$setValidity(a,!0,d)}}else{g||c(b);if(j){if(za(j,k)!=-1)return}else i[a]=j=[],g++,c(!1,a),e.$setValidity(a,!1,d);j.push(k);d.$valid=!1;d.$invalid=!0}};d.$setDirty=function(){b.removeClass(Pa).addClass(Xb);d.$dirty=!0;d.$pristine=!1;e.$setDirty()}}function T(b){return t(b)||b===""||b===null||
|
||||
b!==b}function Qa(b,a,c,d,e,g){var i=function(){var c=R(a.val());d.$viewValue!==c&&b.$apply(function(){d.$setViewValue(c)})};if(e.hasEvent("input"))a.bind("input",i);else{var f;a.bind("keydown",function(a){a=a.keyCode;a===91||15<a&&a<19||37<=a&&a<=40||f||(f=g.defer(function(){i();f=null}))});a.bind("change",i)}d.$render=function(){a.val(T(d.$viewValue)?"":d.$viewValue)};var h=c.ngPattern,k=function(a,b){return T(b)||a.test(b)?(d.$setValidity("pattern",!0),b):(d.$setValidity("pattern",!1),p)};h&&(h.match(/^\/(.*)\/$/)?
|
||||
(h=RegExp(h.substr(1,h.length-2)),e=function(a){return k(h,a)}):e=function(a){var c=b.$eval(h);if(!c||!c.test)throw new B("Expected "+h+" to be a RegExp but was "+c);return k(c,a)},d.$formatters.push(e),d.$parsers.push(e));if(c.ngMinlength){var j=G(c.ngMinlength),e=function(a){return!T(a)&&a.length<j?(d.$setValidity("minlength",!1),p):(d.$setValidity("minlength",!0),a)};d.$parsers.push(e);d.$formatters.push(e)}if(c.ngMaxlength){var l=G(c.ngMaxlength),c=function(a){return!T(a)&&a.length>l?(d.$setValidity("maxlength",
|
||||
!1),p):(d.$setValidity("maxlength",!0),a)};d.$parsers.push(c);d.$formatters.push(c)}}function jb(b,a){b="ngClass"+b;return S(function(c,d,e){function g(b,d){if(a===!0||c.$index%2===a)d&&b!==d&&i(d),f(b)}function i(a){L(a)&&!J(a)&&(a=Ta(a,function(a,b){if(a)return b}));d.removeClass(J(a)?a.join(" "):a)}function f(a){L(a)&&!J(a)&&(a=Ta(a,function(a,b){if(a)return b}));a&&d.addClass(J(a)?a.join(" "):a)}c.$watch(e[b],g,!0);e.$observe("class",function(){var a=c.$eval(e[b]);g(a,a)});b!=="ngClass"&&c.$watch("$index",
|
||||
function(d,g){var j=d%2;j!==g%2&&(j==a?f(c.$eval(e[b])):i(c.$eval(e[b])))})})}var E=function(b){return F(b)?b.toLowerCase():b},la=function(b){return F(b)?b.toUpperCase():b},B=U.Error,aa=G((/msie (\d+)/.exec(E(navigator.userAgent))||[])[1]),u,ja,ia=[].slice,Ra=[].push,Sa=Object.prototype.toString,Yb=U.angular||(U.angular={}),ta,Cb,Z=["0","0","0"];D.$inject=[];ma.$inject=[];Cb=aa<9?function(b){b=b.nodeName?b:b[0];return b.scopeName&&b.scopeName!="HTML"?la(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?
|
||||
b.nodeName:b[0].nodeName};var kc=/[A-Z]/g,id={full:"1.0.3",major:1,minor:0,dot:3,codeName:"bouncy-thunder"},Ba=Q.cache={},Aa=Q.expando="ng-"+(new Date).getTime(),oc=1,Zb=U.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},db=U.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)},mc=/([\:\-\_]+(.))/g,nc=/^moz([A-Z])/,ua=Q.prototype={ready:function(b){function a(){c||(c=!0,b())}
|
||||
var c=!1;this.bind("DOMContentLoaded",a);Q(U).bind("load",a)},toString:function(){var b=[];m(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return b>=0?u(this[b]):u(this[this.length+b])},length:0,push:Ra,sort:[].sort,splice:[].splice},Ea={};m("multiple,selected,checked,disabled,readOnly,required".split(","),function(b){Ea[E(b)]=b});var zb={};m("input,select,option,textarea,button,form".split(","),function(b){zb[la(b)]=!0});m({data:ub,inheritedData:Da,scope:function(b){return Da(b,
|
||||
"$scope")},controller:xb,injector:function(b){return Da(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Ca,css:function(b,a,c){a=rb(a);if(v(c))b.style[a]=c;else{var d;aa<=8&&(d=b.currentStyle&&b.currentStyle[a],d===""&&(d="auto"));d=d||b.style[a];aa<=8&&(d=d===""?p:d);return d}},attr:function(b,a,c){var d=E(a);if(Ea[d])if(v(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||D).specified?d:p;else if(v(c))b.setAttribute(a,
|
||||
c);else if(b.getAttribute)return b=b.getAttribute(a,2),b===null?p:b},prop:function(b,a,c){if(v(c))b[a]=c;else return b[a]},text:x(aa<9?function(b,a){if(b.nodeType==1){if(t(a))return b.innerText;b.innerText=a}else{if(t(a))return b.nodeValue;b.nodeValue=a}}:function(b,a){if(t(a))return b.textContent;b.textContent=a},{$dv:""}),val:function(b,a){if(t(a))return b.value;b.value=a},html:function(b,a){if(t(a))return b.innerHTML;for(var c=0,d=b.childNodes;c<d.length;c++)sa(d[c]);b.innerHTML=a}},function(b,
|
||||
a){Q.prototype[a]=function(a,d){var e,g;if((b.length==2&&b!==Ca&&b!==xb?a:d)===p)if(L(a)){for(e=0;e<this.length;e++)if(b===ub)b(this[e],a);else for(g in a)b(this[e],g,a[g]);return this}else{if(this.length)return b(this[0],a,d)}else{for(e=0;e<this.length;e++)b(this[e],a,d);return this}return b.$dv}});m({removeData:sb,dealoc:sa,bind:function a(c,d,e){var g=$(c,"events"),i=$(c,"handle");g||$(c,"events",g={});i||$(c,"handle",i=pc(c,g));m(d.split(" "),function(d){var h=g[d];if(!h){if(d=="mouseenter"||
|
||||
d=="mouseleave"){var k=0;g.mouseenter=[];g.mouseleave=[];a(c,"mouseover",function(a){k++;k==1&&i(a,"mouseenter")});a(c,"mouseout",function(a){k--;k==0&&i(a,"mouseleave")})}else Zb(c,d,i),g[d]=[];h=g[d]}h.push(e)})},unbind:tb,replaceWith:function(a,c){var d,e=a.parentNode;sa(a);m(new Q(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c,a);d=c})},children:function(a){var c=[];m(a.childNodes,function(a){a.nodeName!="#text"&&c.push(a)});return c},contents:function(a){return a.childNodes},
|
||||
append:function(a,c){m(new Q(c),function(c){a.nodeType===1&&a.appendChild(c)})},prepend:function(a,c){if(a.nodeType===1){var d=a.firstChild;m(new Q(c),function(c){d?a.insertBefore(c,d):(a.appendChild(c),d=c)})}},wrap:function(a,c){var c=u(c)[0],d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)},remove:function(a){sa(a);var c=a.parentNode;c&&c.removeChild(a)},after:function(a,c){var d=a,e=a.parentNode;m(new Q(c),function(a){e.insertBefore(a,d.nextSibling);d=a})},addClass:wb,removeClass:vb,toggleClass:function(a,
|
||||
c,d){t(d)&&(d=!Ca(a,c));(d?wb:vb)(a,c)},parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},next:function(a){return a.nextSibling},find:function(a,c){return a.getElementsByTagName(c)},clone:cb,triggerHandler:function(a,c){var d=($(a,"events")||{})[c];m(d,function(c){c.call(a,null)})}},function(a,c){Q.prototype[c]=function(c,e){for(var g,i=0;i<this.length;i++)g==p?(g=a(this[i],c,e),g!==p&&(g=u(g))):bb(g,a(this[i],c,e));return g==p?this:g}});Fa.prototype={put:function(a,c){this[ga(a)]=
|
||||
c},get:function(a){return this[ga(a)]},remove:function(a){var c=this[a=ga(a)];delete this[a];return c}};eb.prototype={push:function(a,c){var d=this[a=ga(a)];d?d.push(c):this[a]=[c]},shift:function(a){var c=this[a=ga(a)];if(c)return c.length==1?(delete this[a],c[0]):c.shift()},peek:function(a){if(a=this[ga(a)])return a[0]}};var rc=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,sc=/,/,tc=/^\s*(_?)(\S+?)\1\s*$/,qc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Db="Non-assignable model expression: ";Bb.$inject=["$provide"];
|
||||
var Ac=/^(x[\:\-_]|data[\:\-_])/i,Fb=/^([^:]+):\/\/(\w+:{0,1}\w*@)?([\w\.-]*)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,$b=/^([^\?#]*)?(\?([^#]*))?(#(.*))?$/,Hc=$b,Gb={http:80,https:443,ftp:21};gb.prototype={$$replace:!1,absUrl:Ja("$$absUrl"),url:function(a,c){if(t(a))return this.$$url;var d=$b.exec(a);d[1]&&this.path(decodeURIComponent(d[1]));if(d[2]||d[1])this.search(d[3]||"");this.hash(d[5]||"",c);return this},protocol:Ja("$$protocol"),host:Ja("$$host"),port:Ja("$$port"),path:Ib("$$path",function(a){return a.charAt(0)==
|
||||
"/"?a:"/"+a}),search:function(a,c){if(t(a))return this.$$search;v(c)?c===null?delete this.$$search[a]:this.$$search[a]=c:this.$$search=F(a)?Xa(a):a;this.$$compose();return this},hash:Ib("$$hash",ma),replace:function(){this.$$replace=!0;return this}};Ia.prototype=ya(gb.prototype);Hb.prototype=ya(Ia.prototype);var Ka={"null":function(){return null},"true":function(){return!0},"false":function(){return!1},undefined:D,"+":function(a,c,d,e){d=d(a,c);e=e(a,c);return v(d)?v(e)?d+e:d:v(e)?e:p},"-":function(a,
|
||||
c,d,e){d=d(a,c);e=e(a,c);return(v(d)?d:0)-(v(e)?e:0)},"*":function(a,c,d,e){return d(a,c)*e(a,c)},"/":function(a,c,d,e){return d(a,c)/e(a,c)},"%":function(a,c,d,e){return d(a,c)%e(a,c)},"^":function(a,c,d,e){return d(a,c)^e(a,c)},"=":D,"==":function(a,c,d,e){return d(a,c)==e(a,c)},"!=":function(a,c,d,e){return d(a,c)!=e(a,c)},"<":function(a,c,d,e){return d(a,c)<e(a,c)},">":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,
|
||||
c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Lc={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'},hb={},Yc=U.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw new B("This browser does not support XMLHttpRequest.");
|
||||
};Pb.$inject=["$provide"];Qb.$inject=["$locale"];Sb.$inject=["$locale"];var Vb=".",hd={yyyy:P("FullYear",4),yy:P("FullYear",2,0,!0),y:P("FullYear",1),MMMM:La("Month"),MMM:La("Month",!0),MM:P("Month",2,1),M:P("Month",1,1),dd:P("Date",2),d:P("Date",1),HH:P("Hours",2),H:P("Hours",1),hh:P("Hours",2,-12),h:P("Hours",1,-12),mm:P("Minutes",2),m:P("Minutes",1),ss:P("Seconds",2),s:P("Seconds",1),EEEE:La("Day"),EEE:La("Day",!0),a:function(a,c){return a.getHours()<12?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=a.getTimezoneOffset();
|
||||
return ib(a/60,2)+ib(Math.abs(a%60),2)}},gd=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,fd=/^\d+$/;Rb.$inject=["$locale"];var dd=I(E),ed=I(la);Tb.$inject=["$parse"];var jd=I({restrict:"E",compile:function(a,c){c.href||c.$set("href","");return function(a,c){c.bind("click",function(a){if(!c.attr("href"))return a.preventDefault(),!1})}}}),kb={};m(Ea,function(a,c){var d=fa("ng-"+c);kb[d]=function(){return{priority:100,compile:function(){return function(a,g,i){a.$watch(i[d],
|
||||
function(a){i.$set(c,!!a)})}}}}});m(["src","href"],function(a){var c=fa("ng-"+a);kb[c]=function(){return{priority:99,link:function(d,e,g){g.$observe(c,function(c){c&&(g.$set(a,c),aa&&e.prop(a,c))})}}}});var Oa={$addControl:D,$removeControl:D,$setValidity:D,$setDirty:D};Wb.$inject=["$element","$attrs","$scope"];var Ra=function(a){return["$timeout",function(c){var d={name:"form",restrict:"E",controller:Wb,compile:function(){return{pre:function(a,d,i,f){if(!i.action){var h=function(a){a.preventDefault?
|
||||
a.preventDefault():a.returnValue=!1};Zb(d[0],"submit",h);d.bind("$destroy",function(){c(function(){db(d[0],"submit",h)},0,!1)})}var k=d.parent().controller("form"),j=i.name||i.ngForm;j&&(a[j]=f);k&&d.bind("$destroy",function(){k.$removeControl(f);j&&(a[j]=p);x(f,Oa)})}}}};return a?x(V(d),{restrict:"EAC"}):d}]},kd=Ra(),ld=Ra(!0),md=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,nd=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/,od=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,
|
||||
ac={text:Qa,number:function(a,c,d,e,g,i){Qa(a,c,d,e,g,i);e.$parsers.push(function(a){var c=T(a);return c||od.test(a)?(e.$setValidity("number",!0),a===""?null:c?a:parseFloat(a)):(e.$setValidity("number",!1),p)});e.$formatters.push(function(a){return T(a)?"":""+a});if(d.min){var f=parseFloat(d.min),a=function(a){return!T(a)&&a<f?(e.$setValidity("min",!1),p):(e.$setValidity("min",!0),a)};e.$parsers.push(a);e.$formatters.push(a)}if(d.max){var h=parseFloat(d.max),d=function(a){return!T(a)&&a>h?(e.$setValidity("max",
|
||||
!1),p):(e.$setValidity("max",!0),a)};e.$parsers.push(d);e.$formatters.push(d)}e.$formatters.push(function(a){return T(a)||wa(a)?(e.$setValidity("number",!0),a):(e.$setValidity("number",!1),p)})},url:function(a,c,d,e,g,i){Qa(a,c,d,e,g,i);a=function(a){return T(a)||md.test(a)?(e.$setValidity("url",!0),a):(e.$setValidity("url",!1),p)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,c,d,e,g,i){Qa(a,c,d,e,g,i);a=function(a){return T(a)||nd.test(a)?(e.$setValidity("email",!0),a):(e.$setValidity("email",
|
||||
!1),p)};e.$formatters.push(a);e.$parsers.push(a)},radio:function(a,c,d,e){t(d.name)&&c.attr("name",xa());c.bind("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var g=d.ngTrueValue,i=d.ngFalseValue;F(g)||(g=!0);F(i)||(i=!1);c.bind("click",function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$formatters.push(function(a){return a===
|
||||
g});e.$parsers.push(function(a){return a?g:i})},hidden:D,button:D,submit:D,reset:D},bc=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,e,g,i){i&&(ac[E(g.type)]||ac.text)(d,e,g,i,c,a)}}}],Na="ng-valid",Ma="ng-invalid",Pa="ng-pristine",Xb="ng-dirty",pd=["$scope","$exceptionHandler","$attrs","$element","$parse",function(a,c,d,e,g){function i(a,c){c=c?"-"+$a(c,"-"):"";e.removeClass((a?Ma:Na)+c).addClass((a?Na:Ma)+c)}this.$modelValue=this.$viewValue=Number.NaN;
|
||||
this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var f=g(d.ngModel),h=f.assign;if(!h)throw B(Db+d.ngModel+" ("+pa(e)+")");this.$render=D;var k=e.inheritedData("$formController")||Oa,j=0,l=this.$error={};e.addClass(Pa);i(!0);this.$setValidity=function(a,c){if(l[a]!==!c){if(c){if(l[a]&&j--,!j)i(!0),this.$valid=!0,this.$invalid=!1}else i(!1),this.$invalid=!0,this.$valid=!1,j++;l[a]=!c;i(c,a);k.$setValidity(a,
|
||||
c,this)}};this.$setViewValue=function(d){this.$viewValue=d;if(this.$pristine)this.$dirty=!0,this.$pristine=!1,e.removeClass(Pa).addClass(Xb),k.$setDirty();m(this.$parsers,function(a){d=a(d)});if(this.$modelValue!==d)this.$modelValue=d,h(a,d),m(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};var o=this;a.$watch(function(){var c=f(a);if(o.$modelValue!==c){var d=o.$formatters,e=d.length;for(o.$modelValue=c;e--;)c=d[e](c);if(o.$viewValue!==c)o.$viewValue=c,o.$render()}})}],qd=function(){return{require:["ngModel",
|
||||
"^?form"],controller:pd,link:function(a,c,d,e){var g=e[0],i=e[1]||Oa;i.$addControl(g);c.bind("$destroy",function(){i.$removeControl(g)})}}},rd=I({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),cc=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required=!0;var g=function(a){if(d.required&&(T(a)||a===!1))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(g);e.$parsers.unshift(g);
|
||||
d.$observe("required",function(){g(e.$viewValue)})}}}},sd=function(){return{require:"ngModel",link:function(a,c,d,e){var g=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){var c=[];a&&m(a.split(g),function(a){a&&c.push(R(a))});return c});e.$formatters.push(function(a){return J(a)?a.join(", "):p})}}},td=/^(true|false|\d+)$/,ud=function(){return{priority:100,compile:function(a,c){return td.test(c.ngValue)?function(a,c,g){g.$set("value",a.$eval(g.ngValue))}:function(a,
|
||||
c,g){a.$watch(g.ngValue,function(a){g.$set("value",a,!1)})}}}},vd=S(function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==p?"":a)})}),wd=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],xd=[function(){return function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBindHtmlUnsafe);a.$watch(d.ngBindHtmlUnsafe,
|
||||
function(a){c.html(a||"")})}}],yd=jb("",!0),zd=jb("Odd",0),Ad=jb("Even",1),Bd=S({compile:function(a,c){c.$set("ngCloak",p);a.removeClass("ng-cloak")}}),Cd=[function(){return{scope:!0,controller:"@"}}],Dd=["$sniffer",function(a){return{priority:1E3,compile:function(){a.csp=!0}}}],dc={};m("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave".split(" "),function(a){var c=fa("ng-"+a);dc[c]=["$parse",function(d){return function(e,g,i){var f=d(i[c]);g.bind(E(a),function(a){e.$apply(function(){f(e,
|
||||
{$event:a})})})}}]});var Ed=S(function(a,c,d){c.bind("submit",function(){a.$apply(d.ngSubmit)})}),Fd=["$http","$templateCache","$anchorScroll","$compile",function(a,c,d,e){return{restrict:"ECA",terminal:!0,compile:function(g,i){var f=i.ngInclude||i.src,h=i.onload||"",k=i.autoscroll;return function(g,i){var o=0,m,n=function(){m&&(m.$destroy(),m=null);i.html("")};g.$watch(f,function(f){var p=++o;f?a.get(f,{cache:c}).success(function(a){p===o&&(m&&m.$destroy(),m=g.$new(),i.html(a),e(i.contents())(m),
|
||||
v(k)&&(!k||g.$eval(k))&&d(),m.$emit("$includeContentLoaded"),g.$eval(h))}).error(function(){p===o&&n()}):n()})}}}}],Gd=S({compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),Hd=S({terminal:!0,priority:1E3}),Id=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,g,i){var f=i.count,h=g.attr(i.$attr.when),k=i.offset||0,j=e.$eval(h),l={},o=c.startSymbol(),r=c.endSymbol();m(j,function(a,e){l[e]=c(a.replace(d,o+f+"-"+k+r))});e.$watch(function(){var c=
|
||||
parseFloat(e.$eval(f));return isNaN(c)?"":(j[c]||(c=a.pluralCat(c-k)),l[c](e,g,!0))},function(a){g.text(a)})}}}],Jd=S({transclude:"element",priority:1E3,terminal:!0,compile:function(a,c,d){return function(a,c,i){var f=i.ngRepeat,i=f.match(/^\s*(.+)\s+in\s+(.*)\s*$/),h,k,j;if(!i)throw B("Expected ngRepeat in form of '_item_ in _collection_' but got '"+f+"'.");f=i[1];h=i[2];i=f.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!i)throw B("'item' in 'item in collection' should be identifier or (key, value) but got '"+
|
||||
f+"'.");k=i[3]||i[1];j=i[2];var l=new eb;a.$watch(function(a){var e,f,i=a.$eval(h),m=gc(i,!0),p,u=new eb,C,A,v,t,y=c;if(J(i))v=i||[];else{v=[];for(C in i)i.hasOwnProperty(C)&&C.charAt(0)!="$"&&v.push(C);v.sort()}e=0;for(f=v.length;e<f;e++){C=i===v?e:v[e];A=i[C];if(t=l.shift(A)){p=t.scope;u.push(A,t);if(e!==t.index)t.index=e,y.after(t.element);y=t.element}else p=a.$new();p[k]=A;j&&(p[j]=C);p.$index=e;p.$first=e===0;p.$last=e===m-1;p.$middle=!(p.$first||p.$last);t||d(p,function(a){y.after(a);t={scope:p,
|
||||
element:y=a,index:e};u.push(A,t)})}for(C in l)if(l.hasOwnProperty(C))for(v=l[C];v.length;)A=v.pop(),A.element.remove(),A.scope.$destroy();l=u})}}}),Kd=S(function(a,c,d){a.$watch(d.ngShow,function(a){c.css("display",Wa(a)?"":"none")})}),Ld=S(function(a,c,d){a.$watch(d.ngHide,function(a){c.css("display",Wa(a)?"none":"")})}),Md=S(function(a,c,d){a.$watch(d.ngStyle,function(a,d){d&&a!==d&&m(d,function(a,d){c.css(d,"")});a&&c.css(a)},!0)}),Nd=I({restrict:"EA",compile:function(a,c){var d=c.ngSwitch||c.on,
|
||||
e={};a.data("ng-switch",e);return function(a,i){var f,h,k;a.$watch(d,function(d){h&&(k.$destroy(),h.remove(),h=k=null);if(f=e["!"+d]||e["?"])a.$eval(c.change),k=a.$new(),f(k,function(a){h=a;i.append(a)})})}}}),Od=S({transclude:"element",priority:500,compile:function(a,c,d){a=a.inheritedData("ng-switch");qa(a);a["!"+c.ngSwitchWhen]=d}}),Pd=S({transclude:"element",priority:500,compile:function(a,c,d){a=a.inheritedData("ng-switch");qa(a);a["?"]=d}}),Qd=S({controller:["$transclude","$element",function(a,
|
||||
c){a(function(a){c.append(a)})}]}),Rd=["$http","$templateCache","$route","$anchorScroll","$compile","$controller",function(a,c,d,e,g,i){return{restrict:"ECA",terminal:!0,link:function(a,c,k){function j(){var j=d.current&&d.current.locals,k=j&&j.$template;if(k){c.html(k);l&&(l.$destroy(),l=null);var k=g(c.contents()),p=d.current;l=p.scope=a.$new();if(p.controller)j.$scope=l,j=i(p.controller,j),c.contents().data("$ngControllerController",j);k(l);l.$emit("$viewContentLoaded");l.$eval(m);e()}else c.html(""),
|
||||
l&&(l.$destroy(),l=null)}var l,m=k.onload||"";a.$on("$routeChangeSuccess",j);j()}}}],Sd=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,d){d.type=="text/ng-template"&&a.put(d.id,c[0].text)}}}],Td=I({terminal:!0}),Ud=["$compile","$parse",function(a,c){var d=/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/,e={$setViewValue:D};return{restrict:"E",require:["select",
|
||||
"?ngModel"],controller:["$element","$scope","$attrs",function(a,c,d){var h=this,k={},j=e,l;h.databound=d.ngModel;h.init=function(a,c,d){j=a;l=d};h.addOption=function(c){k[c]=!0;j.$viewValue==c&&(a.val(c),l.parent()&&l.remove())};h.removeOption=function(a){this.hasOption(a)&&(delete k[a],j.$viewValue==a&&this.renderUnknownOption(a))};h.renderUnknownOption=function(c){c="? "+ga(c)+" ?";l.val(c);a.prepend(l);a.val(c);l.prop("selected",!0)};h.hasOption=function(a){return k.hasOwnProperty(a)};c.$on("$destroy",
|
||||
function(){h.renderUnknownOption=D})}],link:function(e,i,f,h){function k(a,c,d,e){d.$render=function(){var a=d.$viewValue;e.hasOption(a)?(A.parent()&&A.remove(),c.val(a),a===""&&s.prop("selected",!0)):t(a)&&s?c.val(""):e.renderUnknownOption(a)};c.bind("change",function(){a.$apply(function(){A.parent()&&A.remove();d.$setViewValue(c.val())})})}function j(a,c,d){var e;d.$render=function(){var a=new Fa(d.$viewValue);m(c.children(),function(c){c.selected=v(a.get(c.value))})};a.$watch(function(){ha(e,d.$viewValue)||
|
||||
(e=V(d.$viewValue),d.$render())});c.bind("change",function(){a.$apply(function(){var a=[];m(c.children(),function(c){c.selected&&a.push(c.value)});d.$setViewValue(a)})})}function l(e,f,g){function h(){var a={"":[]},c=[""],d,i,s,t,u;s=g.$modelValue;t=r(e)||[];var y=l?lb(t):t,A,w,x;w={};u=!1;var z,B;if(n)u=new Fa(s);else if(s===null||q)a[""].push({selected:s===null,id:"",label:""}),u=!0;for(x=0;A=y.length,x<A;x++){w[k]=t[l?w[l]=y[x]:x];d=m(e,w)||"";if(!(i=a[d]))i=a[d]=[],c.push(d);n?d=u.remove(o(e,
|
||||
w))!=p:(d=s===o(e,w),u=u||d);z=j(e,w);z=z===p?"":z;i.push({id:l?y[x]:x,label:z,selected:d})}!n&&!u&&a[""].unshift({id:"?",label:"",selected:!0});w=0;for(y=c.length;w<y;w++){d=c[w];i=a[d];if(v.length<=w)s={element:C.clone().attr("label",d),label:i.label},t=[s],v.push(t),f.append(s.element);else if(t=v[w],s=t[0],s.label!=d)s.element.attr("label",s.label=d);z=null;x=0;for(A=i.length;x<A;x++)if(d=i[x],u=t[x+1]){z=u.element;if(u.label!==d.label)z.text(u.label=d.label);if(u.id!==d.id)z.val(u.id=d.id);if(u.element.selected!==
|
||||
d.selected)z.prop("selected",u.selected=d.selected)}else d.id===""&&q?B=q:(B=D.clone()).val(d.id).attr("selected",d.selected).text(d.label),t.push({element:B,label:d.label,id:d.id,selected:d.selected}),z?z.after(B):s.element.append(B),z=B;for(x++;t.length>x;)t.pop().element.remove()}for(;v.length>w;)v.pop()[0].element.remove()}var i;if(!(i=w.match(d)))throw B("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+w+"'.");var j=c(i[2]||i[1]),k=i[4]||
|
||||
i[6],l=i[5],m=c(i[3]||""),o=c(i[2]?i[1]:k),r=c(i[7]),v=[[{element:f,label:""}]];q&&(a(q)(e),q.removeClass("ng-scope"),q.remove());f.html("");f.bind("change",function(){e.$apply(function(){var a,c=r(e)||[],d={},h,i,j,m,q,s;if(n){i=[];m=0;for(s=v.length;m<s;m++){a=v[m];j=1;for(q=a.length;j<q;j++)if((h=a[j].element)[0].selected)h=h.val(),l&&(d[l]=h),d[k]=c[h],i.push(o(e,d))}}else h=f.val(),h=="?"?i=p:h==""?i=null:(d[k]=c[h],l&&(d[l]=h),i=o(e,d));g.$setViewValue(i)})});g.$render=h;e.$watch(h)}if(h[1]){for(var o=
|
||||
h[0],r=h[1],n=f.multiple,w=f.ngOptions,q=!1,s,D=u(ca.createElement("option")),C=u(ca.createElement("optgroup")),A=D.clone(),h=0,x=i.children(),E=x.length;h<E;h++)if(x[h].value==""){s=q=x.eq(h);break}o.init(r,q,A);if(n&&(f.required||f.ngRequired)){var y=function(a){r.$setValidity("required",!f.required||a&&a.length);return a};r.$parsers.push(y);r.$formatters.unshift(y);f.$observe("required",function(){y(r.$viewValue)})}w?l(e,i,r):n?j(e,i,r):k(e,i,r,o)}}}}],Vd=["$interpolate",function(a){var c={addOption:D,
|
||||
removeOption:D};return{restrict:"E",priority:100,compile:function(d,e){if(t(e.value)){var g=a(d.text(),!0);g||e.$set("value",d.text())}return function(a,d,e){var k=d.parent(),j=k.data("$selectController")||k.parent().data("$selectController");j&&j.databound?d.prop("selected",!1):j=c;g?a.$watch(g,function(a,c){e.$set("value",a);a!==c&&j.removeOption(c);j.addOption(a)}):j.addOption(e.value);d.bind("$destroy",function(){j.removeOption(e.value)})}}}}],Wd=I({restrict:"E",terminal:!0});(ja=U.jQuery)?(u=
|
||||
ja,x(ja.fn,{scope:ua.scope,controller:ua.controller,injector:ua.injector,inheritedData:ua.inheritedData}),ab("remove",!0),ab("empty"),ab("html")):u=Q;Yb.element=u;(function(a){x(a,{bootstrap:pb,copy:V,extend:x,equals:ha,element:u,forEach:m,injector:qb,noop:D,bind:Va,toJson:da,fromJson:nb,identity:ma,isUndefined:t,isDefined:v,isString:F,isFunction:N,isObject:L,isNumber:wa,isElement:fc,isArray:J,version:id,isDate:na,lowercase:E,uppercase:la,callbacks:{counter:0}});ta=lc(U);try{ta("ngLocale")}catch(c){ta("ngLocale",
|
||||
[]).provider("$locale",Zc)}ta("ng",["ngLocale"],["$provide",function(a){a.provider("$compile",Bb).directive({a:jd,input:bc,textarea:bc,form:kd,script:Sd,select:Ud,style:Wd,option:Vd,ngBind:vd,ngBindHtmlUnsafe:xd,ngBindTemplate:wd,ngClass:yd,ngClassEven:Ad,ngClassOdd:zd,ngCsp:Dd,ngCloak:Bd,ngController:Cd,ngForm:ld,ngHide:Ld,ngInclude:Fd,ngInit:Gd,ngNonBindable:Hd,ngPluralize:Id,ngRepeat:Jd,ngShow:Kd,ngSubmit:Ed,ngStyle:Md,ngSwitch:Nd,ngSwitchWhen:Od,ngSwitchDefault:Pd,ngOptions:Td,ngView:Rd,ngTransclude:Qd,
|
||||
ngModel:qd,ngList:sd,ngChange:rd,required:cc,ngRequired:cc,ngValue:ud}).directive(kb).directive(dc);a.provider({$anchorScroll:uc,$browser:wc,$cacheFactory:xc,$controller:Bc,$document:Cc,$exceptionHandler:Dc,$filter:Pb,$interpolate:Ec,$http:Vc,$httpBackend:Wc,$location:Ic,$log:Jc,$parse:Nc,$route:Qc,$routeParams:Rc,$rootScope:Sc,$q:Oc,$sniffer:Tc,$templateCache:yc,$timeout:$c,$window:Uc})}])})(Yb);u(ca).ready(function(){jc(ca,pb)})})(window,document);angular.element(document).find("head").append('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none;}ng\\:form{display:block;}</style>');
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 8.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 12 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,483 +0,0 @@
|
|||
|
||||
/******** Grid Global ********/
|
||||
.nglabel {
|
||||
display: block;
|
||||
float: left;
|
||||
font-weight: bold;
|
||||
padding-right: 5px;
|
||||
}
|
||||
/******** Grid ********/
|
||||
|
||||
.ngGrid{
|
||||
background-color: rgb(253, 253, 253);
|
||||
}
|
||||
.ngGrid.unselectable {
|
||||
-moz-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
/******** Header ********/
|
||||
|
||||
.ngGroupPanel{
|
||||
background-color: rgb(234, 234, 234);
|
||||
overflow: hidden;
|
||||
border-bottom: 1px solid rgb(212,212,212);
|
||||
}
|
||||
|
||||
.ngGroupPanelDescription{
|
||||
margin-top: 5px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.ngGroupList {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ngGroupItem {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.ngGroupElement {
|
||||
float: left;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ngGroupName {
|
||||
background-color: rgb(247,247,247);
|
||||
border: 1px solid rgb(212,212,212);
|
||||
padding: 3px 10px;
|
||||
float: left;
|
||||
margin-left: 0;
|
||||
margin-top: 2px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ngGroupItem:first-child{
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.ngRemoveGroup {
|
||||
width: 5px;
|
||||
-moz-opacity: 0.4;
|
||||
opacity: 0.4;
|
||||
margin-top: -1px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
.ngRemoveGroup:hover {
|
||||
color: black;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
-moz-opacity: 0.7;
|
||||
opacity: 0.7;
|
||||
}
|
||||
.ngGroupArrow {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 6px solid transparent;
|
||||
border-bottom: 6px solid transparent;
|
||||
border-left: 6px solid black;
|
||||
margin-top: 10px;
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.ngTopPanel {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
background-color: rgb(234, 234, 234);
|
||||
border-bottom: 1px solid rgb(212,212,212);
|
||||
}
|
||||
.ngHeaderContainer {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
font-weight: bold;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.ngHeaderScroller {
|
||||
position:absolute;
|
||||
background-color: inherit;
|
||||
}
|
||||
.ngHeaderSortColumn{
|
||||
position:absolute;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ngHeaderCell{
|
||||
border-right: 1px solid rgb(212,212,212);
|
||||
border-left: 1px solid rgb(212,212,212);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.ngHeaderCell:first-child{
|
||||
border-left: 0;
|
||||
}
|
||||
.ngHeaderCell.pinned {
|
||||
z-index: 1;
|
||||
}
|
||||
.ngSortButtonUp {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
border-color: gray transparent;
|
||||
border-style: solid;
|
||||
border-width: 0 5px 5px 5px;
|
||||
height: 0;
|
||||
width: 0;
|
||||
}
|
||||
.ngSortButtonDown {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
border-color: gray transparent;
|
||||
border-style: solid;
|
||||
border-width: 5px 5px 0 5px;
|
||||
height: 0;
|
||||
width: 0;
|
||||
}
|
||||
.ngSortPriority {
|
||||
position: absolute;
|
||||
top: -5px;
|
||||
left: 1px;
|
||||
font-size: 6pt;
|
||||
font-weight: bold;
|
||||
}
|
||||
.ngHeaderGrip {
|
||||
cursor: col-resize;
|
||||
width: 10px;
|
||||
right: -5px;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
background-color: transparent;
|
||||
}
|
||||
.ngHeaderText {
|
||||
padding: 5px;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
-ms-text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/******** Viewport ********/
|
||||
.ngViewport{
|
||||
overflow: auto;
|
||||
min-height: 20px;
|
||||
}
|
||||
|
||||
.ngCanvas{
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/******** Rows ********/
|
||||
.ngRow {
|
||||
position: absolute;
|
||||
border-bottom: 1px solid rgb(229, 229, 229);
|
||||
}
|
||||
.ngRow.even {
|
||||
background-color: rgb(243, 243, 243);
|
||||
}
|
||||
.ngRow.odd {
|
||||
background-color: rgb(253, 253, 253);
|
||||
}
|
||||
.ngRow.selected {
|
||||
background-color: rgb(201, 221, 225);
|
||||
}
|
||||
.ngRow.canSelect {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/******** Cells ********/
|
||||
|
||||
.ngCell {
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
border-right: 1px solid rgb(212,212,212);
|
||||
border-left: 1px solid rgb(212,212,212);
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.ngCell:first-child{
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
.ngCell.pinned {
|
||||
z-index: 1;
|
||||
}
|
||||
.ngCellElement:focus {
|
||||
outline: 0;
|
||||
background-color: rgb(179, 196, 199);
|
||||
}
|
||||
|
||||
.ngCellText {
|
||||
padding: 5px;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
-ms-text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
.ngSelectionHeader {
|
||||
position: absolute;
|
||||
top: 11px;
|
||||
left: 6px;
|
||||
}
|
||||
.ngGrid input[type="checkbox"] {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.ngGrid input {
|
||||
vertical-align:top;
|
||||
}
|
||||
.ngSelectionCell{
|
||||
margin-top: 9px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
.ngSelectionCheckbox{
|
||||
margin-top: 9px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
.ngNoSort {
|
||||
cursor:default;
|
||||
}
|
||||
|
||||
/******** Footer ********/
|
||||
.ngFooterPanel{
|
||||
background-color: rgb(234, 234, 234);
|
||||
padding: 0;
|
||||
border-top: 1px solid rgb(212,212,212);
|
||||
position: relative;
|
||||
}
|
||||
.ngTotalSelectContainer {
|
||||
float: left;
|
||||
margin: 5px;
|
||||
margin-top: 7px;
|
||||
}
|
||||
.ngFooterSelectedItems {
|
||||
padding: 2px;
|
||||
}
|
||||
.ngFooterTotalItems {
|
||||
padding: 2px;
|
||||
}
|
||||
.ngFooterTotalItems.ngnoMultiSelect {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
/* Aggregates */
|
||||
.ngAggHeader {
|
||||
position: absolute;
|
||||
border: none;
|
||||
}
|
||||
.ngAggregate {
|
||||
position: absolute;
|
||||
background-color: rgb(201, 221, 225);
|
||||
border-bottom: 1px solid beige;
|
||||
overflow: hidden;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: -1px;
|
||||
left: 0;
|
||||
}
|
||||
.ngAggregateText {
|
||||
position: absolute;
|
||||
left: 27px;
|
||||
top: 5px;
|
||||
line-height: 20px;
|
||||
white-space:nowrap;
|
||||
}
|
||||
.ngAggArrowExpanded {
|
||||
position: absolute;
|
||||
left: 8px;
|
||||
bottom: 10px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: 0 0 9px 9px;
|
||||
border-color: transparent transparent #000000 transparent;
|
||||
}
|
||||
.ngAggArrowCollapsed {
|
||||
position: absolute;
|
||||
left: 8px;
|
||||
bottom: 10px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: 5px 0 5px 8.7px;
|
||||
border-color: transparent transparent transparent #000000;
|
||||
}
|
||||
|
||||
.ngHeaderButton {
|
||||
position: absolute;
|
||||
right: 2px;
|
||||
top: 8px;
|
||||
-moz-border-radius: 50%;
|
||||
-webkit-border-radius: 50%;
|
||||
border-radius: 50%;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
z-index: 1;
|
||||
background-color: rgb(179, 191, 188);
|
||||
cursor: pointer;
|
||||
/* width and height can be anything, as long as they're equal */
|
||||
}
|
||||
.ngHeaderButtonArrow {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 3px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: 6.5px 4.5px 0 4.5px;
|
||||
border-color: #000 transparent transparent transparent;
|
||||
/* width and height can be anything, as long as they're equal */
|
||||
}
|
||||
.ngColMenu {
|
||||
right: 2px;
|
||||
padding: 5px;
|
||||
top: 25px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
background-color: #BDD0CB;
|
||||
position: absolute;
|
||||
border: 2px solid rgb(212,212,212);
|
||||
z-index: 1;
|
||||
}
|
||||
.ngMenuText {
|
||||
position: relative;
|
||||
top: 2px;
|
||||
left: 2px;
|
||||
}
|
||||
.ngColList {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.ngColListItem {
|
||||
position: relative;
|
||||
right: 17px;
|
||||
top: 2px;
|
||||
white-space:nowrap;
|
||||
}
|
||||
.ngColListCheckbox {
|
||||
position: relative;
|
||||
right: 3px;
|
||||
top: 4px;
|
||||
}
|
||||
|
||||
/********Paging Styles **********/
|
||||
|
||||
.ngPagerButton{
|
||||
height: 25px;
|
||||
min-width: 26px;
|
||||
}
|
||||
|
||||
.ngPagerFirstTriangle{
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: 5px 8.7px 5px 0;
|
||||
border-color: transparent #000000 transparent transparent;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.ngPagerFirstBar{
|
||||
width: 10px;
|
||||
border-left: 2px solid black;
|
||||
margin-top: -6px;
|
||||
height: 12px;
|
||||
margin-left: -3px;
|
||||
}
|
||||
|
||||
.ngPagerLastTriangle{
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: 5px 0 5px 8.7px;
|
||||
border-color: transparent transparent transparent #000000;
|
||||
margin-left: -1px;
|
||||
}
|
||||
|
||||
.ngPagerLastBar{
|
||||
width: 10px;
|
||||
border-left: 2px solid black;
|
||||
margin-top: -6px;
|
||||
height: 12px;
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
||||
.ngPagerPrevTriangle{
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.ngPagerNextTriangle{
|
||||
margin-left: 1px;
|
||||
}
|
||||
.ngGroupIcon {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAANCAYAAACZ3F9/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAEFJREFUKFNjoAhISkr+h2J5JDZODNXGwGBsbPwfhIGAA8bGh6HaGBiAGhxAGJmND4M1gQCSM0adCsVQbcPcqQwMALWDGyDvWPefAAAAAElFTkSuQmCC);
|
||||
background-repeat:no-repeat;
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
position: absolute;
|
||||
right: -2px;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.ngGroupedByIcon {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAANCAYAAACZ3F9/AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAElJREFUKFNjoAhISkr+R8LyaHwMDNXGwGBsbPwfhoGAA5mPDUO1oWpE52PDYE0gALTFAYbR+dgwWBMIoPlh1I9ADNU2NPzIwAAAFQYI9E4OLvEAAAAASUVORK5CYII=);
|
||||
background-repeat:no-repeat;
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
position: absolute;
|
||||
right: -2px;
|
||||
top: 2px;
|
||||
}
|
||||
.ngPinnedIcon {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAAmElEQVQoU33PQapBURjA8UtkwJuaWYGSgfQWYBMvczPmTCzAAGVuaA228BZhRCkDGSmE31FucuRfvzq3vr5zT/JSjSU7DsypEPXDkDVn2hSIytJhw4kWGaLCxgHh2gt/RBuLzNhz5caWPjnSqqw4EraFfwznf8qklWjwy4IRTerkiQoPGtPl40OehcEJvcfXl8LglLfBJLkDcMgbgHlHhK8AAAAASUVORK5CYII=);
|
||||
background-repeat: no-repeat;
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 5px;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}
|
||||
.ngUnPinnedIcon {
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAAlElEQVQoU33PPQrCQBRF4fFnI2KfZVi5ARvdgo1l6mwmkCJVOgluwd5OwUoDtnoOxAei8cLXTN7cvEl/skCNDCMPfsUPO5zQwOHIDEvYtMURHe6wOVLgigvOePRyeDkyR4ln7wZ//7XfFBu8B23+aDJjrHGAwza7hjtHJvDmHg7b7Bru7AMjK7Rw2ObBVHDY5oGk9AKQNB2zy8MBTgAAAABJRU5ErkJggg==);
|
||||
background-repeat: no-repeat;
|
||||
position: absolute;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
right: 5px;
|
||||
top: 5px;
|
||||
}
|
||||
.ngGroupingNumber {
|
||||
position: absolute;
|
||||
right: -10px;
|
||||
top: -2px;
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
{
|
||||
"name": "ng-grid",
|
||||
"version": "2.0.3",
|
||||
"description": "__Contributors:__",
|
||||
"main": "ng-grid.min.js",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/angular-ui/ng-grid.git"
|
||||
},
|
||||
"keywords": [
|
||||
"angular",
|
||||
"ng-grid",
|
||||
"nggrid",
|
||||
"grid",
|
||||
"angularjs",
|
||||
"slickgrid",
|
||||
"kogrid"
|
||||
],
|
||||
"author": "ng-grid Team",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.0",
|
||||
"grunt-jsdoc": "~0.2.4",
|
||||
"grunt-contrib-concat": "~0.1.3",
|
||||
"grunt-contrib-uglify": "~0.1.2",
|
||||
"grunt-angular-templates": "~0.3.0",
|
||||
"grunt-contrib-clean": "~0.4.0",
|
||||
"grunt-contrib-jasmine": "~0.3.3"
|
||||
}
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
Notes
|
||||
=====
|
||||
|
||||
For anyone else writing plugins, please feel free to add to this readme.
|
||||
|
||||
Flexible-Height
|
||||
===============
|
||||
|
||||
Automatically resize a table to accomodate a varying number of rows.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
A semi-ugly hack to make tables shrink automatically so you dont have big ugly gray space to worry about .
|
||||
|
||||
plugins: [new ngGridFlexibleHeightPlugin()]
|
||||
|
||||
Options
|
||||
-------
|
||||
|
||||
opts =
|
||||
{ minHeight: <minimum height in px> }
|
||||
|
||||
CSV-Export
|
||||
==========
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Add CSV Export to your ng-grid tables by including it in your plugins array:
|
||||
|
||||
plugins: [new ngGridCsvExportPlugin()]
|
||||
|
||||
Options
|
||||
-------
|
||||
|
||||
opts =
|
||||
{ columnOverrides: < hash of column override functions > }
|
||||
|
||||
For arrays and objects you may want to override the default `JSON.stringify`
|
||||
conversion into strings.
|
||||
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
// Todo:
|
||||
// 1) Make the button prettier
|
||||
// 2) add a config option for IE users which takes a URL. That URL should accept a POST request with a
|
||||
// JSON encoded object in the payload and return a CSV. This is necessary because IE doesn't let you
|
||||
// download from a data-uri link
|
||||
//
|
||||
// Notes: This has not been adequately tested and is very much a proof of concept at this point
|
||||
ngGridCsvExportPlugin = function(opts) {
|
||||
var self = this;
|
||||
self.grid = null;
|
||||
self.scope = null;
|
||||
self.init = function(scope, grid, services) {
|
||||
self.grid = grid;
|
||||
self.scope = scope;
|
||||
function showDs() {
|
||||
var keys = [];
|
||||
for (var f in grid.config.columnDefs) { keys.push(grid.config.columnDefs[f].field);}
|
||||
var csvData = '';
|
||||
function csvStringify(str) {
|
||||
if (str == null) return ''; // we want to catch anything null-ish, hence just == not ===
|
||||
if (typeof(str) === 'number') return '' + str;
|
||||
if (typeof(str) === 'boolean') return (str ? 'TRUE' : 'FALSE') ;
|
||||
if (typeof(str) === 'string') return str.replace(/"/g,'""');
|
||||
return JSON.stringify(str).replace(/"/g,'""');
|
||||
}
|
||||
function swapLastCommaForNewline(str) {
|
||||
var newStr = str.substr(0,str.length - 1);
|
||||
return newStr + "\n";
|
||||
}
|
||||
for (var k in keys) {
|
||||
csvData += '"' + csvStringify(keys[k]) + '",';
|
||||
}
|
||||
csvData = swapLastCommaForNewline(csvData);
|
||||
var gridData = grid.data;
|
||||
for (var gridRow in gridData) {
|
||||
for ( k in keys) {
|
||||
var curCellRaw;
|
||||
if (opts != null && opts.columnOverrides != null && opts.columnOverrides[keys[k]] != null) {
|
||||
curCellRaw = opts.columnOverrides[keys[k]](gridData[gridRow][keys[k]]);
|
||||
} else {
|
||||
curCellRaw = gridData[gridRow][keys[k]];
|
||||
}
|
||||
csvData += '"' + csvStringify(curCellRaw) + '",';
|
||||
}
|
||||
csvData = swapLastCommaForNewline(csvData);
|
||||
}
|
||||
var fp = grid.$root.find(".ngFooterPanel");
|
||||
var csvDataLinkPrevious = grid.$root.find('.ngFooterPanel .csv-data-link-span');
|
||||
if (csvDataLinkPrevious != null) {csvDataLinkPrevious.remove() ; }
|
||||
var csvDataLinkHtml = "<span class=\"csv-data-link-span\">";
|
||||
csvDataLinkHtml += "<br><a href=\"data:text/csv;charset=UTF-8,";
|
||||
csvDataLinkHtml += encodeURIComponent(csvData);
|
||||
csvDataLinkHtml += "\" download=\"Export.csv\">CSV Export</a></br></span>" ;
|
||||
fp.append(csvDataLinkHtml);
|
||||
}
|
||||
setTimeout(showDs, 0);
|
||||
scope.catHashKeys = function() {
|
||||
hash = '';
|
||||
for (idx in scope.renderedRows) { hash += scope.renderedRows[idx].$$hashKey; }
|
||||
return hash;
|
||||
};
|
||||
scope.$watch('catHashKeys()', showDs);
|
||||
};
|
||||
};
|
|
@ -1,40 +0,0 @@
|
|||
ngGridFlexibleHeightPlugin = function(opts) {
|
||||
var self = this;
|
||||
self.grid = null;
|
||||
self.scope = null;
|
||||
self.init = function(scope, grid, services) {
|
||||
self.grid = grid;
|
||||
self.scope = scope;
|
||||
var recalcHeightForData = function () { setTimeout(innerRecalcForData, 1); } ;
|
||||
var innerRecalcForData = function () {
|
||||
var rowCount = self.grid.data.length;
|
||||
var gridId = self.grid.gridId;
|
||||
var topPanelSel = '.' + gridId + ' .ngTopPanel';
|
||||
var footerPanelSel = '.' + gridId + ' .ngFooterPanel';
|
||||
var canvasSel = '.' + gridId + ' .ngCanvas';
|
||||
var viewportSel = '.' + gridId + ' .ngViewport';
|
||||
var extraHeight = $(topPanelSel).height() + $(footerPanelSel).height();
|
||||
var naturalHeight = $(canvasSel).height() + 15;
|
||||
if (scope.baseViewportHeight == null || scope.baseViewportHeight == 0) {
|
||||
scope.baseViewportHeight = $(viewportSel).height();
|
||||
}
|
||||
if (scope.baseViewportHeight > naturalHeight ) {
|
||||
if (opts != null) {
|
||||
if (opts.minHeight != null && (naturalHeight + extraHeight) < opts.minHeight) {
|
||||
naturalHeight = opts.minHeight - extraHeight - 2;
|
||||
}
|
||||
}
|
||||
$(viewportSel).css('height', (naturalHeight + 2) + 'px');
|
||||
$('.' + gridId).css('height', (naturalHeight + extraHeight + 2) + 'px');
|
||||
}
|
||||
self.grid.refreshDomSizes();
|
||||
};
|
||||
scope.catHashKeys = function() {
|
||||
hash = '';
|
||||
for (idx in scope.renderedRows) { hash += scope.renderedRows[idx].$$hashKey; }
|
||||
return hash;
|
||||
};
|
||||
scope.$watch('catHashKeys()', innerRecalcForData);
|
||||
scope.$watch (grid.config.data, recalcHeightForData);
|
||||
};
|
||||
};
|
|
@ -1,16 +0,0 @@
|
|||
ngGridLayoutPlugin = function() {
|
||||
var self = this;
|
||||
this.grid = null;
|
||||
this.scope = null;
|
||||
this.init = function(scope, grid, services) {
|
||||
self.domUtilityService = services.DomUtilityService;
|
||||
self.grid = grid;
|
||||
self.scope = scope;
|
||||
};
|
||||
|
||||
this.updateGridLayout = function () {
|
||||
self.scope.$apply(function(){
|
||||
self.domUtilityService.RebuildGrid(self.scope, self.grid);
|
||||
});
|
||||
};
|
||||
}
|
|
@ -1,197 +0,0 @@
|
|||
/*
|
||||
DO NOT USE THIS PLUGIN. IT IS ONLY AN EXAMPLE FOR INSTRUCTIONAL PURPOSES.
|
||||
*/
|
||||
|
||||
ngGridReorderable = function(options) {
|
||||
var defaults = {
|
||||
enableHeader: true,
|
||||
enableRow: true
|
||||
};
|
||||
var self = this;
|
||||
self.config = $.extend(defaults, options);
|
||||
self.$scope = null;
|
||||
self.myGrid = null;
|
||||
|
||||
// The init method gets called during the ng-grid directive execution.
|
||||
self.init = function(scope, grid, services) {
|
||||
// The directive passes in the grid scope and the grid object which we will want to save for manipulation later.
|
||||
self.$scope = scope;
|
||||
self.myGrid = grid;
|
||||
self.services = services;
|
||||
// In this example we want to assign grid events.
|
||||
self.assignEvents();
|
||||
};
|
||||
self.colToMove = undefined;
|
||||
self.groupToMove = undefined;
|
||||
self.assignEvents = function() {
|
||||
// Here we set the onmousedown event handler to the header container.
|
||||
self.myGrid.$groupPanel.on('mousedown', self.onGroupMouseDown).on('dragover', self.dragOver).on('drop', self.onGroupDrop);
|
||||
|
||||
if (self.config.enableHeader) {
|
||||
self.myGrid.$headerScroller.on('mousedown', self.onHeaderMouseDown).on('dragover', self.dragOver).on('drop', self.onHeaderDrop);
|
||||
}
|
||||
if (self.config.enableRow) {
|
||||
self.myGrid.$viewport.on('mousedown', self.onRowMouseDown).on('dragover', self.dragOver).on('drop', self.onRowDrop);
|
||||
}
|
||||
};
|
||||
self.dragOver = function(evt) {
|
||||
evt.preventDefault();
|
||||
};
|
||||
|
||||
self.onGroupDragStart = function() {
|
||||
// color the header so we know what we are moving
|
||||
if (self.groupToMove) {
|
||||
self.groupToMove.header.css('background-color', 'rgb(255, 255, 204)');
|
||||
}
|
||||
};
|
||||
|
||||
self.onGroupDragStop = function() {
|
||||
// Set the column to move header color back to normal
|
||||
if (self.groupToMove) {
|
||||
self.groupToMove.header.css('background-color', 'rgb(247,247,247)');
|
||||
}
|
||||
};
|
||||
|
||||
self.onGroupMouseDown = function(event) {
|
||||
var groupItem = $(event.srcElement);
|
||||
// Get the scope from the header container
|
||||
if (groupItem[0].className != 'ngRemoveGroup') {
|
||||
var groupItemScope = angular.element(groupItem).scope();
|
||||
if (groupItemScope) {
|
||||
// set draggable events
|
||||
groupItem.attr('draggable', 'true');
|
||||
groupItem.on('dragstart', self.onGroupDragStart).on('dragend', self.onGroupDragStop);
|
||||
// Save the column for later.
|
||||
self.groupToMove = { header: groupItem, groupName: groupItemScope.group, index: groupItemScope.$index };
|
||||
}
|
||||
} else {
|
||||
self.groupToMove = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
self.onGroupDrop = function(event) {
|
||||
// clear out the colToMove object
|
||||
if (self.groupToMove) {
|
||||
self.onGroupDragStop();
|
||||
// Get the closest header to where we dropped
|
||||
var groupContainer = $(event.srcElement).closest('.ngGroupElement');
|
||||
// Get the scope from the header.
|
||||
if (groupContainer.context.className == 'ngGroupPanel') {
|
||||
self.$scope.configGroups.splice(self.groupToMove.index, 1);
|
||||
self.$scope.configGroups.push(self.groupToMove.groupName);
|
||||
} else {
|
||||
var groupScope = angular.element(groupContainer).scope();
|
||||
if (groupScope) {
|
||||
// If we have the same column, do nothing.
|
||||
if (self.groupToMove.index != groupScope.$index) {
|
||||
// Splice the columns
|
||||
self.$scope.configGroups.splice(self.groupToMove.index, 1);
|
||||
self.$scope.configGroups.splice(groupScope.$index, 0, self.groupToMove.groupName);
|
||||
}
|
||||
}
|
||||
}
|
||||
self.groupToMove = undefined;
|
||||
} else {
|
||||
self.onHeaderDragStop();
|
||||
if (self.$scope.configGroups.indexOf(self.colToMove.col) == -1) {
|
||||
self.$scope.configGroups.push(self.colToMove.col);
|
||||
}
|
||||
self.colToMove = undefined;
|
||||
}
|
||||
self.$scope.$digest();
|
||||
};
|
||||
|
||||
//Header functions
|
||||
self.onHeaderMouseDown = function(event) {
|
||||
// Get the closest header container from where we clicked.
|
||||
var headerContainer = $(event.srcElement).closest('.ngHeaderSortColumn');
|
||||
// Get the scope from the header container
|
||||
var headerScope = angular.element(headerContainer).scope();
|
||||
if (headerScope) {
|
||||
// set draggable events
|
||||
headerContainer.attr('draggable', 'true');
|
||||
headerContainer.on('dragstart', self.onHeaderDragStart).on('dragend', self.onHeaderDragStop);
|
||||
// Save the column for later.
|
||||
self.colToMove = { header: headerContainer, col: headerScope.col };
|
||||
}
|
||||
};
|
||||
|
||||
self.onHeaderDragStart = function() {
|
||||
// color the header so we know what we are moving
|
||||
if (self.colToMove) {
|
||||
self.colToMove.header.css('background-color', 'rgb(255, 255, 204)');
|
||||
}
|
||||
};
|
||||
|
||||
self.onHeaderDragStop = function() {
|
||||
// Set the column to move header color back to normal
|
||||
if (self.colToMove) {
|
||||
self.colToMove.header.css('background-color', 'rgb(234, 234, 234)');
|
||||
}
|
||||
};
|
||||
|
||||
self.onHeaderDrop = function(event) {
|
||||
if (!self.colToMove) {
|
||||
return;
|
||||
}
|
||||
self.onHeaderDragStop();
|
||||
// Get the closest header to where we dropped
|
||||
var headerContainer = $(event.srcElement).closest('.ngHeaderSortColumn');
|
||||
// Get the scope from the header.
|
||||
var headerScope = angular.element(headerContainer).scope();
|
||||
if (headerScope) {
|
||||
// If we have the same column, do nothing.
|
||||
if (self.colToMove.col == headerScope.col) {
|
||||
return;
|
||||
}
|
||||
// Splice the columns
|
||||
self.$scope.columns.splice(self.colToMove.col.index, 1);
|
||||
self.$scope.columns.splice(headerScope.col.index, 0, self.colToMove.col);
|
||||
// Fix all the indexes on the columns so if we reorder again the columns will line up correctly.
|
||||
angular.forEach(self.$scope.columns, function(col, i) {
|
||||
col.index = i;
|
||||
});
|
||||
// Finally, rebuild the CSS styles.
|
||||
self.myGrid.cssBuilder.buildStyles();
|
||||
// clear out the colToMove object
|
||||
self.colToMove = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
// Row functions
|
||||
self.onRowMouseDown = function(event) {
|
||||
// Get the closest row element from where we clicked.
|
||||
var targetRow = $(event.srcElement).closest('.ngRow');
|
||||
// Get the scope from the row element
|
||||
var rowScope = angular.element(targetRow).scope();
|
||||
if (rowScope) {
|
||||
// set draggable events
|
||||
targetRow.attr('draggable', 'true');
|
||||
// Save the row for later.
|
||||
self.services.GridService.eventStorage.rowToMove = { targetRow: targetRow, scope: rowScope };
|
||||
}
|
||||
};
|
||||
|
||||
self.onRowDrop = function(event) {
|
||||
// Get the closest row to where we dropped
|
||||
var targetRow = $(event.srcElement).closest('.ngRow');
|
||||
// Get the scope from the row element.
|
||||
var rowScope = angular.element(targetRow).scope();
|
||||
if (rowScope) {
|
||||
// If we have the same Row, do nothing.
|
||||
var prevRow = self.services.GridService.eventStorage.rowToMove;
|
||||
if (prevRow.scope.row == rowScope.row) {
|
||||
return;
|
||||
}
|
||||
// Splice the Rows via the actual datasource
|
||||
var i = self.myGrid.sortedData.indexOf(prevRow.scope.row.entity);
|
||||
var j = self.myGrid.sortedData.indexOf(rowScope.row.entity);
|
||||
self.myGrid.sortedData.splice(i, 1);
|
||||
self.myGrid.sortedData.splice(j, 0, prevRow.scope.row.entity);
|
||||
self.myGrid.rowFactory.sortedDataChanged(self.myGrid.sortedData);
|
||||
// clear out the rowToMove object
|
||||
self.services.GridService.eventStorage.rowToMove = undefined;
|
||||
// if there isn't an apply already in progress lets start one
|
||||
}
|
||||
};
|
||||
};
|
|
@ -1,41 +0,0 @@
|
|||
ngGridWYSIWYGPlugin = function (filter) {
|
||||
var self = this;
|
||||
self.grid = null;
|
||||
self.scope = null;
|
||||
|
||||
self.init = function (scope, grid) {
|
||||
self.grid = grid;
|
||||
self.scope = scope;
|
||||
};
|
||||
|
||||
self.export = function () {
|
||||
var ret = {
|
||||
columns: [],
|
||||
columnWidths: [],
|
||||
gridWidth: self.scope.totalRowWidth(),
|
||||
data: []
|
||||
};
|
||||
angular.forEach(self.scope.columns, function (col) {
|
||||
if (col.visible) {
|
||||
ret.columns.push(col.displayName);
|
||||
ret.columnWidths.push(col.width);
|
||||
}
|
||||
});
|
||||
angular.forEach(self.grid.filteredRows, function (item) {
|
||||
angular.forEach(self.scope.columns, function (col) {
|
||||
if (col.visible) {
|
||||
var obj = ng.utils.evalProperty(item, col.field);
|
||||
var val = null;
|
||||
if (col.cellFilter) {
|
||||
val = filter(col.cellFilter)(obj);
|
||||
} else {
|
||||
val = obj;
|
||||
}
|
||||
ret.data.push(val ? val.toString() : '');
|
||||
}
|
||||
});
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
return self;
|
||||
};
|
|
@ -1,81 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html ng-app="myApp">
|
||||
<head lang="en">
|
||||
<meta charset="utf-8">
|
||||
<title>Custom Plunker</title>
|
||||
<link rel="stylesheet" type="text/css" href="http://angular-ui.github.com/ng-grid/css/ng-grid.css" />
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"></script>
|
||||
<script type="text/javascript" src="../build/ng-grid.debug.js"></script>
|
||||
<script type="text/javascript" src="ng-grid-csv-export.js"></script>
|
||||
<script type="text/javascript" src="ng-grid-flexible-height.js"></script>
|
||||
<style type="text/css">
|
||||
.gridStyle
|
||||
{ border: 1px solid rgb(212,212,212)
|
||||
; height: 1400px
|
||||
; width: 80%
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
// main.js
|
||||
var app = angular.module('myApp', ['ngGrid']);
|
||||
app.controller('MyCtrl', function($scope) {
|
||||
csvOpts = { columnOverrides: { obj: function(o) { return o.a + '|' + o.b; } } }
|
||||
hgtOpts = { minHeight: 200 } ;
|
||||
$scope.myDataSmall = [ {hasThing: false, obj: {a:5, b:6}, name: "Moroni", age: 50, ln: 'sdf'}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "Tiasdfsdfnd", age: 43}
|
||||
]
|
||||
$scope.myDataBig = [ {hasThing: false, obj: {a:5, b:6}, name: "Moroni", age: 50, ln: 'sdf'}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "Tiasdfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "asdfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "Tiasdfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "iadfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "iafsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "iafsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "iafsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "iadfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "iadfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "iadfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "Tisdfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "Tiasdfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "Tiasdfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "Tiasdfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "Tiasdfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "Tiasdfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "Tiasdfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "Tiasdfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "Tiasdfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "Tiasdfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:6, b:7}, ln: "Tiasdfsdfnd", age: 43}
|
||||
, {hasThing: false, obj: {a:5, b:7}, name: "Jacob", age: 27}
|
||||
, {hasThing: true, obj: {a:2, b:8}, ln: "Tiasdfsdfnd", age: 43}
|
||||
, {hasThing: true, obj: {a:1, b:8}, ln: "Jacob", age: 27}
|
||||
, {hasThing: false, obj: {a:7, b:9}, name: "Tiasdfsdfnd", age: 43}
|
||||
, {hasThing: false, obj: {a:5, b:9}, name: "Jacob", age: 27}
|
||||
, {hasThing: true, obj: {a:5, b:7}, name: "Nephi", age: 29}
|
||||
, {hasThing: false, obj: {a:5, b:7}, name: "Enos", age: 34}
|
||||
];
|
||||
$scope.gridOptionsBig = {
|
||||
data: 'myDataBig',
|
||||
plugins: [new ngGridCsvExportPlugin(csvOpts),new ngGridFlexibleHeightPlugin(hgtOpts)],
|
||||
showGroupPanel: true
|
||||
};
|
||||
$scope.gridOptionsSmall = {
|
||||
data: 'myDataSmall',
|
||||
plugins: [new ngGridCsvExportPlugin(csvOpts),new ngGridFlexibleHeightPlugin()],
|
||||
showGroupPanel: true
|
||||
};
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body ng-controller="MyCtrl">
|
||||
<div> <a ng-click="myDataSmall.push(myDataBig[0])"> add one to small </a></div>
|
||||
<div> <a ng-click="myDataSmall.pop()"> remove one from small </a> </div>
|
||||
<div class="gridStyle" ng-grid="gridOptionsSmall"></div>
|
||||
<hr>
|
||||
<div> <a ng-click="myDataBig.push(myDataSmall[0])"> add one to big </a> </div>
|
||||
<div> <a ng-click="myDataBig.pop()"> remove one from big </a> </div>
|
||||
<div class="gridStyle" ng-grid="gridOptionsBig"></div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,74 +0,0 @@
|
|||
var ngAggregate = function (aggEntity, rowFactory, rowHeight) {
|
||||
var self = this;
|
||||
self.rowIndex = 0;
|
||||
self.offsetTop = self.rowIndex * rowHeight;
|
||||
self.entity = aggEntity;
|
||||
self.label = aggEntity.gLabel;
|
||||
self.field = aggEntity.gField;
|
||||
self.depth = aggEntity.gDepth;
|
||||
self.parent = aggEntity.parent;
|
||||
self.children = aggEntity.children;
|
||||
self.aggChildren = aggEntity.aggChildren;
|
||||
self.aggIndex = aggEntity.aggIndex;
|
||||
self.collapsed = true;
|
||||
self.isAggRow = true;
|
||||
self.offsetleft = aggEntity.gDepth * 25;
|
||||
self.aggLabelFilter = aggEntity.aggLabelFilter;
|
||||
self.toggleExpand = function() {
|
||||
self.collapsed = self.collapsed ? false : true;
|
||||
if (self.orig) {
|
||||
self.orig.collapsed = self.collapsed;
|
||||
}
|
||||
self.notifyChildren();
|
||||
};
|
||||
self.setExpand = function(state) {
|
||||
self.collapsed = state;
|
||||
self.notifyChildren();
|
||||
};
|
||||
self.notifyChildren = function () {
|
||||
var longest = Math.max(rowFactory.aggCache.length, self.children.length);
|
||||
for (var i = 0; i < longest; i++) {
|
||||
if (self.aggChildren[i]) {
|
||||
self.aggChildren[i].entity[NG_HIDDEN] = self.collapsed;
|
||||
if (self.collapsed) {
|
||||
self.aggChildren[i].setExpand(self.collapsed);
|
||||
}
|
||||
}
|
||||
if (self.children[i]) {
|
||||
self.children[i][NG_HIDDEN] = self.collapsed;
|
||||
}
|
||||
if (i > self.aggIndex && rowFactory.aggCache[i]) {
|
||||
var agg = rowFactory.aggCache[i];
|
||||
var offset = (30 * self.children.length);
|
||||
agg.offsetTop = self.collapsed ? agg.offsetTop - offset : agg.offsetTop + offset;
|
||||
}
|
||||
};
|
||||
rowFactory.renderedChange();
|
||||
};
|
||||
self.aggClass = function() {
|
||||
return self.collapsed ? "ngAggArrowCollapsed" : "ngAggArrowExpanded";
|
||||
};
|
||||
self.totalChildren = function() {
|
||||
if (self.aggChildren.length > 0) {
|
||||
var i = 0;
|
||||
var recurse = function(cur) {
|
||||
if (cur.aggChildren.length > 0) {
|
||||
angular.forEach(cur.aggChildren, function(a) {
|
||||
recurse(a);
|
||||
});
|
||||
} else {
|
||||
i += cur.children.length;
|
||||
}
|
||||
};
|
||||
recurse(self);
|
||||
return i;
|
||||
} else {
|
||||
return self.children.length;
|
||||
}
|
||||
};
|
||||
self.copy = function () {
|
||||
var ret = new ngAggregate(self.entity, rowFactory, rowHeight);
|
||||
ret.orig = self;
|
||||
return ret;
|
||||
};
|
||||
};
|
|
@ -1,170 +0,0 @@
|
|||
var ngColumn = function (config, $scope, grid, domUtilityService, $templateCache, $utils) {
|
||||
var self = this,
|
||||
colDef = config.colDef,
|
||||
delay = 500,
|
||||
clicks = 0,
|
||||
timer = null;
|
||||
self.width = colDef.width;
|
||||
self.groupIndex = 0;
|
||||
self.isGroupedBy = false;
|
||||
self.minWidth = !colDef.minWidth ? 50 : colDef.minWidth;
|
||||
self.maxWidth = !colDef.maxWidth ? 9000 : colDef.maxWidth;
|
||||
self.enableCellEdit = config.enableCellEdit || colDef.enableCellEdit;
|
||||
self.headerRowHeight = config.headerRowHeight;
|
||||
self.displayName = colDef.displayName || colDef.field;
|
||||
self.index = config.index;
|
||||
self.isAggCol = config.isAggCol;
|
||||
self.cellClass = colDef.cellClass;
|
||||
self.sortPriority = undefined;
|
||||
self.cellFilter = colDef.cellFilter ? colDef.cellFilter : "";
|
||||
self.field = colDef.field;
|
||||
self.aggLabelFilter = colDef.cellFilter || colDef.aggLabelFilter;
|
||||
self.visible = $utils.isNullOrUndefined(colDef.visible) || colDef.visible;
|
||||
self.sortable = false;
|
||||
self.resizable = false;
|
||||
self.pinnable = false;
|
||||
self.pinned = (config.enablePinning && colDef.pinned);
|
||||
self.originalIndex = self.index;
|
||||
self.groupable = $utils.isNullOrUndefined(colDef.groupable) || colDef.groupable;
|
||||
if (config.enableSort) {
|
||||
self.sortable = $utils.isNullOrUndefined(colDef.sortable) || colDef.sortable;
|
||||
}
|
||||
if (config.enableResize) {
|
||||
self.resizable = $utils.isNullOrUndefined(colDef.resizable) || colDef.resizable;
|
||||
}
|
||||
if (config.enablePinning) {
|
||||
self.pinnable = $utils.isNullOrUndefined(colDef.pinnable) || colDef.pinnable;
|
||||
}
|
||||
self.sortDirection = undefined;
|
||||
self.sortingAlgorithm = colDef.sortFn;
|
||||
self.headerClass = colDef.headerClass;
|
||||
self.cursor = self.sortable ? 'pointer' : 'default';
|
||||
self.headerCellTemplate = colDef.headerCellTemplate || $templateCache.get('headerCellTemplate.html');
|
||||
self.cellTemplate = colDef.cellTemplate || $templateCache.get('cellTemplate.html').replace(CUSTOM_FILTERS, self.cellFilter ? "|" + self.cellFilter : "");
|
||||
if(self.enableCellEdit) {
|
||||
self.cellEditTemplate = $templateCache.get('cellEditTemplate.html');
|
||||
self.editableCellTemplate = colDef.editableCellTemplate || $templateCache.get('editableCellTemplate.html');
|
||||
}
|
||||
if (colDef.cellTemplate && !TEMPLATE_REGEXP.test(colDef.cellTemplate)) {
|
||||
self.cellTemplate = $.ajax({
|
||||
type: "GET",
|
||||
url: colDef.cellTemplate,
|
||||
async: false
|
||||
}).responseText;
|
||||
}
|
||||
if (self.enableCellEdit && colDef.editableCellTemplate && !TEMPLATE_REGEXP.test(colDef.editableCellTemplate)) {
|
||||
self.editableCellTemplate = $.ajax({
|
||||
type: "GET",
|
||||
url: colDef.editableCellTemplate,
|
||||
async: false
|
||||
}).responseText;
|
||||
}
|
||||
if (colDef.headerCellTemplate && !TEMPLATE_REGEXP.test(colDef.headerCellTemplate)) {
|
||||
self.headerCellTemplate = $.ajax({
|
||||
type: "GET",
|
||||
url: colDef.headerCellTemplate,
|
||||
async: false
|
||||
}).responseText;
|
||||
}
|
||||
self.colIndex = function () {
|
||||
var classes = self.pinned ? "pinned " : "";
|
||||
classes += "col" + self.index + " colt" + self.index;
|
||||
return classes;
|
||||
};
|
||||
self.groupedByClass = function() {
|
||||
return self.isGroupedBy ? "ngGroupedByIcon" : "ngGroupIcon";
|
||||
};
|
||||
self.toggleVisible = function() {
|
||||
self.visible = !self.visible;
|
||||
};
|
||||
self.showSortButtonUp = function() {
|
||||
return self.sortable ? self.sortDirection === DESC : self.sortable;
|
||||
};
|
||||
self.showSortButtonDown = function() {
|
||||
return self.sortable ? self.sortDirection === ASC : self.sortable;
|
||||
};
|
||||
self.noSortVisible = function() {
|
||||
return !self.sortDirection;
|
||||
};
|
||||
self.sort = function(evt) {
|
||||
if (!self.sortable) {
|
||||
return true; // column sorting is disabled, do nothing
|
||||
}
|
||||
var dir = self.sortDirection === ASC ? DESC : ASC;
|
||||
self.sortDirection = dir;
|
||||
config.sortCallback(self, evt);
|
||||
return false;
|
||||
};
|
||||
self.gripClick = function() {
|
||||
clicks++; //count clicks
|
||||
if (clicks === 1) {
|
||||
timer = setTimeout(function() {
|
||||
//Here you can add a single click action.
|
||||
clicks = 0; //after action performed, reset counter
|
||||
}, delay);
|
||||
} else {
|
||||
clearTimeout(timer); //prevent single-click action
|
||||
config.resizeOnDataCallback(self); //perform double-click action
|
||||
clicks = 0; //after action performed, reset counter
|
||||
}
|
||||
};
|
||||
self.gripOnMouseDown = function(event) {
|
||||
if (event.ctrlKey && !self.pinned) {
|
||||
self.toggleVisible();
|
||||
domUtilityService.BuildStyles($scope, grid);
|
||||
return true;
|
||||
}
|
||||
event.target.parentElement.style.cursor = 'col-resize';
|
||||
self.startMousePosition = event.clientX;
|
||||
self.origWidth = self.width;
|
||||
$(document).mousemove(self.onMouseMove);
|
||||
$(document).mouseup(self.gripOnMouseUp);
|
||||
return false;
|
||||
};
|
||||
self.onMouseMove = function(event) {
|
||||
var diff = event.clientX - self.startMousePosition;
|
||||
var newWidth = diff + self.origWidth;
|
||||
self.width = (newWidth < self.minWidth ? self.minWidth : (newWidth > self.maxWidth ? self.maxWidth : newWidth));
|
||||
domUtilityService.BuildStyles($scope, grid);
|
||||
return false;
|
||||
};
|
||||
self.gripOnMouseUp = function (event) {
|
||||
$(document).off('mousemove', self.onMouseMove);
|
||||
$(document).off('mouseup', self.gripOnMouseUp);
|
||||
event.target.parentElement.style.cursor = 'default';
|
||||
$scope.adjustScrollLeft(0);
|
||||
domUtilityService.digest($scope);
|
||||
return false;
|
||||
};
|
||||
self.copy = function() {
|
||||
var ret = new ngColumn(config, $scope, grid, domUtilityService, $templateCache);
|
||||
ret.isClone = true;
|
||||
ret.orig = self;
|
||||
return ret;
|
||||
};
|
||||
self.setVars = function (fromCol) {
|
||||
self.orig = fromCol;
|
||||
self.width = fromCol.width;
|
||||
self.groupIndex = fromCol.groupIndex;
|
||||
self.isGroupedBy = fromCol.isGroupedBy;
|
||||
self.displayName = fromCol.displayName;
|
||||
self.index = fromCol.index;
|
||||
self.isAggCol = fromCol.isAggCol;
|
||||
self.cellClass = fromCol.cellClass;
|
||||
self.cellFilter = fromCol.cellFilter;
|
||||
self.field = fromCol.field;
|
||||
self.aggLabelFilter = fromCol.aggLabelFilter;
|
||||
self.visible = fromCol.visible;
|
||||
self.sortable = fromCol.sortable;
|
||||
self.resizable = fromCol.resizable;
|
||||
self.pinnable = fromCol.pinnable;
|
||||
self.pinned = fromCol.pinned;
|
||||
self.originalIndex = fromCol.originalIndex;
|
||||
self.sortDirection = fromCol.sortDirection;
|
||||
self.sortingAlgorithm = fromCol.sortingAlgorithm;
|
||||
self.headerClass = fromCol.headerClass;
|
||||
self.headerCellTemplate = fromCol.headerCellTemplate;
|
||||
self.cellTemplate = fromCol.cellTemplate;
|
||||
self.cellEditTemplate = fromCol.cellEditTemplate;
|
||||
};
|
||||
};
|
|
@ -1,5 +0,0 @@
|
|||
var ngDimension = function (options) {
|
||||
this.outerHeight = null;
|
||||
this.outerWidth = null;
|
||||
$.extend(this, options);
|
||||
};
|
|
@ -1,62 +0,0 @@
|
|||
var ngDomAccessProvider = function (grid) {
|
||||
var self = this, previousColumn;
|
||||
self.selectInputElement = function(elm){
|
||||
var node = elm.nodeName.toLowerCase();
|
||||
if(node == 'input' || node == 'textarea'){
|
||||
elm.select();
|
||||
}
|
||||
};
|
||||
|
||||
self.focusCellElement = function($scope, index){
|
||||
if($scope.selectionProvider.lastClickedRow){
|
||||
var columnIndex = index != undefined ? index : previousColumn;
|
||||
var elm = $scope.selectionProvider.lastClickedRow.clone ? $scope.selectionProvider.lastClickedRow.clone.elm : $scope.selectionProvider.lastClickedRow.elm;
|
||||
if (columnIndex != undefined && elm) {
|
||||
var columns = angular.element(elm[0].children).filter(function () { return this.nodeType != 8;}); //Remove html comments for IE8
|
||||
var i = Math.max(Math.min($scope.renderedColumns.length - 1, columnIndex), 0);
|
||||
if(grid.config.showSelectionCheckbox && angular.element(columns[i]).scope() && angular.element(columns[i]).scope().col.index == 0){
|
||||
i = 1; //don't want to focus on checkbox
|
||||
}
|
||||
if (columns[i]) {
|
||||
columns[i].children[0].focus();
|
||||
}
|
||||
previousColumn = columnIndex;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var changeUserSelect = function(elm, value) {
|
||||
elm.css({
|
||||
'-webkit-touch-callout': value,
|
||||
'-webkit-user-select': value,
|
||||
'-khtml-user-select': value,
|
||||
'-moz-user-select': value == 'none'
|
||||
? '-moz-none'
|
||||
: value,
|
||||
'-ms-user-select': value,
|
||||
'user-select': value
|
||||
});
|
||||
};
|
||||
|
||||
self.selectionHandlers = function($scope, elm){
|
||||
var doingKeyDown = false;
|
||||
elm.bind('keydown', function(evt) {
|
||||
if (evt.keyCode == 16) { //shift key
|
||||
changeUserSelect(elm, 'none', evt);
|
||||
return true;
|
||||
} else if (!doingKeyDown) {
|
||||
doingKeyDown = true;
|
||||
var ret = ngMoveSelectionHandler($scope, elm, evt, grid);
|
||||
doingKeyDown = false;
|
||||
return ret;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
elm.bind('keyup', function(evt) {
|
||||
if (evt.keyCode == 16) { //shift key
|
||||
changeUserSelect(elm, 'text', evt);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
};
|
||||
};
|
|
@ -1,232 +0,0 @@
|
|||
var ngEventProvider = function (grid, $scope, domUtilityService, $timeout) {
|
||||
var self = this;
|
||||
// The init method gets called during the ng-grid directive execution.
|
||||
self.colToMove = undefined;
|
||||
self.groupToMove = undefined;
|
||||
self.assignEvents = function() {
|
||||
// Here we set the onmousedown event handler to the header container.
|
||||
if (grid.config.jqueryUIDraggable && !grid.config.enablePinning) {
|
||||
grid.$groupPanel.droppable({
|
||||
addClasses: false,
|
||||
drop: function(event) {
|
||||
self.onGroupDrop(event);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
grid.$groupPanel.on('mousedown', self.onGroupMouseDown).on('dragover', self.dragOver).on('drop', self.onGroupDrop);
|
||||
grid.$headerScroller.on('mousedown', self.onHeaderMouseDown).on('dragover', self.dragOver);
|
||||
if (grid.config.enableColumnReordering && !grid.config.enablePinning) {
|
||||
grid.$headerScroller.on('drop', self.onHeaderDrop);
|
||||
}
|
||||
if (grid.config.enableRowReordering) {
|
||||
grid.$viewport.on('mousedown', self.onRowMouseDown).on('dragover', self.dragOver).on('drop', self.onRowDrop);
|
||||
}
|
||||
}
|
||||
$scope.$watch('renderedColumns', function() {
|
||||
$timeout(self.setDraggables);
|
||||
});
|
||||
};
|
||||
self.dragStart = function(evt){
|
||||
//FireFox requires there to be dataTransfer if you want to drag and drop.
|
||||
evt.dataTransfer.setData('text', ''); //cannot be empty string
|
||||
};
|
||||
self.dragOver = function(evt) {
|
||||
evt.preventDefault();
|
||||
};
|
||||
//For JQueryUI
|
||||
self.setDraggables = function() {
|
||||
if (!grid.config.jqueryUIDraggable) {
|
||||
//Fix for FireFox. Instead of using jQuery on('dragstart', function) on find, we have to use addEventListeners for each column.
|
||||
var columns = grid.$root.find('.ngHeaderSortColumn'); //have to iterate if using addEventListener
|
||||
angular.forEach(columns, function(col){
|
||||
col.setAttribute('draggable', 'true');
|
||||
//jQuery 'on' function doesn't have dataTransfer as part of event in handler unless added to event props, which is not recommended
|
||||
//See more here: http://api.jquery.com/category/events/event-object/
|
||||
if (col.addEventListener) { //IE8 doesn't have drag drop or event listeners
|
||||
col.addEventListener('dragstart', self.dragStart);
|
||||
}
|
||||
});
|
||||
if (navigator.userAgent.indexOf("MSIE") != -1){
|
||||
//call native IE dragDrop() to start dragging
|
||||
grid.$root.find('.ngHeaderSortColumn').bind('selectstart', function () {
|
||||
this.dragDrop();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
grid.$root.find('.ngHeaderSortColumn').draggable({
|
||||
helper: 'clone',
|
||||
appendTo: 'body',
|
||||
stack: 'div',
|
||||
addClasses: false,
|
||||
start: function(event) {
|
||||
self.onHeaderMouseDown(event);
|
||||
}
|
||||
}).droppable({
|
||||
drop: function(event) {
|
||||
self.onHeaderDrop(event);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
self.onGroupMouseDown = function(event) {
|
||||
var groupItem = $(event.target);
|
||||
// Get the scope from the header container
|
||||
if (groupItem[0].className != 'ngRemoveGroup') {
|
||||
var groupItemScope = angular.element(groupItem).scope();
|
||||
if (groupItemScope) {
|
||||
// set draggable events
|
||||
if (!grid.config.jqueryUIDraggable) {
|
||||
groupItem.attr('draggable', 'true');
|
||||
if(this.addEventListener){//IE8 doesn't have drag drop or event listeners
|
||||
this.addEventListener('dragstart', self.dragStart);
|
||||
}
|
||||
if (navigator.userAgent.indexOf("MSIE") != -1){
|
||||
//call native IE dragDrop() to start dragging
|
||||
groupItem.bind('selectstart', function () {
|
||||
this.dragDrop();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
// Save the column for later.
|
||||
self.groupToMove = { header: groupItem, groupName: groupItemScope.group, index: groupItemScope.$index };
|
||||
}
|
||||
} else {
|
||||
self.groupToMove = undefined;
|
||||
}
|
||||
};
|
||||
self.onGroupDrop = function(event) {
|
||||
event.stopPropagation();
|
||||
// clear out the colToMove object
|
||||
var groupContainer;
|
||||
var groupScope;
|
||||
if (self.groupToMove) {
|
||||
// Get the closest header to where we dropped
|
||||
groupContainer = $(event.target).closest('.ngGroupElement'); // Get the scope from the header.
|
||||
if (groupContainer.context.className == 'ngGroupPanel') {
|
||||
$scope.configGroups.splice(self.groupToMove.index, 1);
|
||||
$scope.configGroups.push(self.groupToMove.groupName);
|
||||
} else {
|
||||
groupScope = angular.element(groupContainer).scope();
|
||||
if (groupScope) {
|
||||
// If we have the same column, do nothing.
|
||||
if (self.groupToMove.index != groupScope.$index) {
|
||||
// Splice the columns
|
||||
$scope.configGroups.splice(self.groupToMove.index, 1);
|
||||
$scope.configGroups.splice(groupScope.$index, 0, self.groupToMove.groupName);
|
||||
}
|
||||
}
|
||||
}
|
||||
self.groupToMove = undefined;
|
||||
grid.fixGroupIndexes();
|
||||
} else if (self.colToMove) {
|
||||
if ($scope.configGroups.indexOf(self.colToMove.col) == -1) {
|
||||
groupContainer = $(event.target).closest('.ngGroupElement'); // Get the scope from the header.
|
||||
if (groupContainer.context.className == 'ngGroupPanel' || groupContainer.context.className == 'ngGroupPanelDescription ng-binding') {
|
||||
$scope.groupBy(self.colToMove.col);
|
||||
} else {
|
||||
groupScope = angular.element(groupContainer).scope();
|
||||
if (groupScope) {
|
||||
// Splice the columns
|
||||
$scope.removeGroup(groupScope.$index);
|
||||
}
|
||||
}
|
||||
}
|
||||
self.colToMove = undefined;
|
||||
}
|
||||
if (!$scope.$$phase) {
|
||||
$scope.$apply();
|
||||
}
|
||||
};
|
||||
//Header functions
|
||||
self.onHeaderMouseDown = function(event) {
|
||||
// Get the closest header container from where we clicked.
|
||||
var headerContainer = $(event.target).closest('.ngHeaderSortColumn');
|
||||
// Get the scope from the header container
|
||||
var headerScope = angular.element(headerContainer).scope();
|
||||
if (headerScope) {
|
||||
// Save the column for later.
|
||||
self.colToMove = { header: headerContainer, col: headerScope.col };
|
||||
}
|
||||
};
|
||||
self.onHeaderDrop = function(event) {
|
||||
if (!self.colToMove || self.colToMove.col.pinned) {
|
||||
return;
|
||||
}
|
||||
// Get the closest header to where we dropped
|
||||
var headerContainer = $(event.target).closest('.ngHeaderSortColumn');
|
||||
// Get the scope from the header.
|
||||
var headerScope = angular.element(headerContainer).scope();
|
||||
if (headerScope) {
|
||||
// If we have the same column, do nothing.
|
||||
if (self.colToMove.col == headerScope.col) {
|
||||
return;
|
||||
}
|
||||
// Splice the columns
|
||||
$scope.columns.splice(self.colToMove.col.index, 1);
|
||||
$scope.columns.splice(headerScope.col.index, 0, self.colToMove.col);
|
||||
grid.fixColumnIndexes();
|
||||
// Finally, rebuild the CSS styles.
|
||||
domUtilityService.BuildStyles($scope, grid, true);
|
||||
// clear out the colToMove object
|
||||
self.colToMove = undefined;
|
||||
}
|
||||
};
|
||||
// Row functions
|
||||
self.onRowMouseDown = function(event) {
|
||||
// Get the closest row element from where we clicked.
|
||||
var targetRow = $(event.target).closest('.ngRow');
|
||||
// Get the scope from the row element
|
||||
var rowScope = angular.element(targetRow).scope();
|
||||
if (rowScope) {
|
||||
// set draggable events
|
||||
targetRow.attr('draggable', 'true');
|
||||
// Save the row for later.
|
||||
domUtilityService.eventStorage.rowToMove = { targetRow: targetRow, scope: rowScope };
|
||||
}
|
||||
};
|
||||
self.onRowDrop = function(event) {
|
||||
// Get the closest row to where we dropped
|
||||
var targetRow = $(event.target).closest('.ngRow');
|
||||
// Get the scope from the row element.
|
||||
var rowScope = angular.element(targetRow).scope();
|
||||
if (rowScope) {
|
||||
// If we have the same Row, do nothing.
|
||||
var prevRow = domUtilityService.eventStorage.rowToMove;
|
||||
if (prevRow.scope.row == rowScope.row) {
|
||||
return;
|
||||
}
|
||||
grid.changeRowOrder(prevRow.scope.row, rowScope.row);
|
||||
grid.searchProvider.evalFilter();
|
||||
// clear out the rowToMove object
|
||||
domUtilityService.eventStorage.rowToMove = undefined;
|
||||
// if there isn't an apply already in progress lets start one
|
||||
domUtilityService.digest(rowScope.$root);
|
||||
}
|
||||
};
|
||||
|
||||
self.assignGridEventHandlers = function() {
|
||||
//Chrome and firefox both need a tab index so the grid can recieve focus.
|
||||
//need to give the grid a tabindex if it doesn't already have one so
|
||||
//we'll just give it a tab index of the corresponding gridcache index
|
||||
//that way we'll get the same result every time it is run.
|
||||
//configurable within the options.
|
||||
if (grid.config.tabIndex === -1) {
|
||||
grid.$viewport.attr('tabIndex', domUtilityService.numberOfGrids);
|
||||
domUtilityService.numberOfGrids++;
|
||||
} else {
|
||||
grid.$viewport.attr('tabIndex', grid.config.tabIndex);
|
||||
}// resize on window resize
|
||||
$(window).resize(function() {
|
||||
domUtilityService.RebuildGrid($scope,grid);
|
||||
});
|
||||
// resize on parent resize as well.
|
||||
$(grid.$root.parent()).on('resize', function() {
|
||||
domUtilityService.RebuildGrid($scope, grid);
|
||||
});
|
||||
};
|
||||
// In this example we want to assign grid events.
|
||||
self.assignGridEventHandlers();
|
||||
self.assignEvents();
|
||||
};
|
|
@ -1,58 +0,0 @@
|
|||
var ngFooter = function ($scope, grid) {
|
||||
$scope.maxRows = function () {
|
||||
var ret = Math.max($scope.pagingOptions.totalServerItems, grid.data.length);
|
||||
return ret;
|
||||
};
|
||||
|
||||
$scope.multiSelect = (grid.config.enableRowSelection && grid.config.multiSelect);
|
||||
$scope.selectedItemCount = grid.selectedItemCount;
|
||||
$scope.maxPages = function () {
|
||||
return Math.ceil($scope.maxRows() / $scope.pagingOptions.pageSize);
|
||||
};
|
||||
|
||||
$scope.pageForward = function() {
|
||||
var page = $scope.pagingOptions.currentPage;
|
||||
if ($scope.pagingOptions.totalServerItems > 0) {
|
||||
$scope.pagingOptions.currentPage = Math.min(page + 1, $scope.maxPages());
|
||||
} else {
|
||||
$scope.pagingOptions.currentPage++;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.pageBackward = function() {
|
||||
var page = $scope.pagingOptions.currentPage;
|
||||
$scope.pagingOptions.currentPage = Math.max(page - 1, 1);
|
||||
};
|
||||
|
||||
$scope.pageToFirst = function() {
|
||||
$scope.pagingOptions.currentPage = 1;
|
||||
};
|
||||
|
||||
$scope.pageToLast = function() {
|
||||
var maxPages = $scope.maxPages();
|
||||
$scope.pagingOptions.currentPage = maxPages;
|
||||
};
|
||||
|
||||
$scope.cantPageForward = function() {
|
||||
var curPage = $scope.pagingOptions.currentPage;
|
||||
var maxPages = $scope.maxPages();
|
||||
if ($scope.pagingOptions.totalServerItems > 0) {
|
||||
return !(curPage < maxPages);
|
||||
} else {
|
||||
return grid.data.length < 1;
|
||||
}
|
||||
|
||||
};
|
||||
$scope.cantPageToLast = function() {
|
||||
if ($scope.pagingOptions.totalServerItems > 0) {
|
||||
return $scope.cantPageForward();
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.cantPageBackward = function() {
|
||||
var curPage = $scope.pagingOptions.currentPage;
|
||||
return !(curPage > 1);
|
||||
};
|
||||
};
|
|
@ -1,809 +0,0 @@
|
|||
/// <reference path="footer.js" />
|
||||
/// <reference path="../services/SortService.js" />
|
||||
/// <reference path="../../lib/jquery-1.8.2.min" />
|
||||
var ngGrid = function ($scope, options, sortService, domUtilityService, $filter, $templateCache, $utils, $timeout, $parse) {
|
||||
var defaults = {
|
||||
//Define an aggregate template to customize the rows when grouped. See github wiki for more details.
|
||||
aggregateTemplate: undefined,
|
||||
|
||||
//Callback for when you want to validate something after selection.
|
||||
afterSelectionChange: function() {
|
||||
},
|
||||
|
||||
/* Callback if you want to inspect something before selection,
|
||||
return false if you want to cancel the selection. return true otherwise.
|
||||
If you need to wait for an async call to proceed with selection you can
|
||||
use rowItem.changeSelection(event) method after returning false initially.
|
||||
Note: when shift+ Selecting multiple items in the grid this will only get called
|
||||
once and the rowItem will be an array of items that are queued to be selected. */
|
||||
beforeSelectionChange: function() {
|
||||
return true;
|
||||
},
|
||||
|
||||
//checkbox templates.
|
||||
checkboxCellTemplate: undefined,
|
||||
checkboxHeaderTemplate: undefined,
|
||||
|
||||
//definitions of columns as an array [], if not defines columns are auto-generated. See github wiki for more details.
|
||||
columnDefs: undefined,
|
||||
|
||||
//*Data being displayed in the grid. Each item in the array is mapped to a row being displayed.
|
||||
data: [],
|
||||
|
||||
//Data updated callback, fires every time the data is modified from outside the grid.
|
||||
dataUpdated: function() {
|
||||
},
|
||||
|
||||
//Enables cell editing.
|
||||
enableCellEdit: false,
|
||||
|
||||
//Enables cell selection.
|
||||
enableCellSelection: false,
|
||||
|
||||
//Enable or disable resizing of columns
|
||||
enableColumnResize: false,
|
||||
|
||||
//Enable or disable reordering of columns
|
||||
enableColumnReordering: false,
|
||||
|
||||
//Enable or disable HEAVY column virtualization. This turns off selection checkboxes and column pinning and is designed for spreadsheet-like data.
|
||||
enableColumnHeavyVirt: false,
|
||||
|
||||
//Enables the server-side paging feature
|
||||
enablePaging: false,
|
||||
|
||||
//Enable column pinning
|
||||
enablePinning: false,
|
||||
|
||||
//Enable drag and drop row reordering. Only works in HTML5 compliant browsers.
|
||||
enableRowReordering: false,
|
||||
|
||||
//To be able to have selectable rows in grid.
|
||||
enableRowSelection: true,
|
||||
|
||||
//Enables or disables sorting in grid.
|
||||
enableSorting: true,
|
||||
|
||||
//Enables or disables text highlighting in grid by adding the "unselectable" class (See CSS file)
|
||||
enableHighlighting: false,
|
||||
|
||||
// string list of properties to exclude when auto-generating columns.
|
||||
excludeProperties: [],
|
||||
|
||||
/* filterOptions -
|
||||
filterText: The text bound to the built-in search box.
|
||||
useExternalFilter: Bypass internal filtering if you want to roll your own filtering mechanism but want to use builtin search box.
|
||||
*/
|
||||
filterOptions: {
|
||||
filterText: "",
|
||||
useExternalFilter: false
|
||||
},
|
||||
|
||||
//Defining the height of the footer in pixels.
|
||||
footerRowHeight: 55,
|
||||
|
||||
// the template for the column menu and filter, including the button.
|
||||
footerTemplate: undefined,
|
||||
|
||||
//Initial fields to group data by. Array of field names, not displayName.
|
||||
groups: [],
|
||||
|
||||
//The height of the header row in pixels.
|
||||
headerRowHeight: 30,
|
||||
|
||||
//Define a header row template for further customization. See github wiki for more details.
|
||||
headerRowTemplate: undefined,
|
||||
|
||||
/*Enables the use of jquery UI reaggable/droppable plugin. requires jqueryUI to work if enabled.
|
||||
Useful if you want drag + drop but your users insist on crappy browsers. */
|
||||
jqueryUIDraggable: false,
|
||||
|
||||
//Enable the use jqueryUIThemes
|
||||
jqueryUITheme: false,
|
||||
|
||||
//Prevent unselections when in single selection mode.
|
||||
keepLastSelected: true,
|
||||
|
||||
/*Maintains the column widths while resizing.
|
||||
Defaults to true when using *'s or undefined widths. Can be ovverriden by setting to false.*/
|
||||
maintainColumnRatios: undefined,
|
||||
|
||||
// the template for the column menu and filter, including the button.
|
||||
menuTemplate: undefined,
|
||||
|
||||
//Set this to false if you only want one item selected at a time
|
||||
multiSelect: true,
|
||||
|
||||
// pagingOptions -
|
||||
|
||||
pagingOptions: {
|
||||
// pageSizes: list of available page sizes.
|
||||
pageSizes: [250, 500, 1000],
|
||||
//pageSize: currently selected page size.
|
||||
pageSize: 250,
|
||||
//totalServerItems: Total items are on the server.
|
||||
totalServerItems: 0,
|
||||
//currentPage: the uhm... current page.
|
||||
currentPage: 1
|
||||
},
|
||||
|
||||
//the selection checkbox is pinned to the left side of the viewport or not.
|
||||
pinSelectionCheckbox: false,
|
||||
|
||||
//Array of plugin functions to register in ng-grid
|
||||
plugins: [],
|
||||
|
||||
//User defined unique ID field that allows for better handling of selections and for server-side paging
|
||||
primaryKey: undefined,
|
||||
|
||||
//Row height of rows in grid.
|
||||
rowHeight: 30,
|
||||
|
||||
//Define a row template to customize output. See github wiki for more details.
|
||||
rowTemplate: undefined,
|
||||
|
||||
//all of the items selected in the grid. In single select mode there will only be one item in the array.
|
||||
selectedItems: [],
|
||||
|
||||
//Disable row selections by clicking on the row and only when the checkbox is clicked.
|
||||
selectWithCheckboxOnly: false,
|
||||
|
||||
/*Enables menu to choose which columns to display and group by.
|
||||
If both showColumnMenu and showFilter are false the menu button will not display.*/
|
||||
showColumnMenu: false,
|
||||
|
||||
/*Enables display of the filterbox in the column menu.
|
||||
If both showColumnMenu and showFilter are false the menu button will not display.*/
|
||||
showFilter: false,
|
||||
|
||||
//Show or hide the footer alltogether the footer is enabled by default
|
||||
showFooter: false,
|
||||
|
||||
//Show the dropzone for drag and drop grouping
|
||||
showGroupPanel: false,
|
||||
|
||||
//Row selection check boxes appear as the first column.
|
||||
showSelectionCheckbox: false,
|
||||
|
||||
/*Define a sortInfo object to specify a default sorting state.
|
||||
You can also observe this variable to utilize server-side sorting (see useExternalSorting).
|
||||
Syntax is sortinfo: { fields: ['fieldName1',' fieldName2'], direction: 'ASC'/'asc' || 'desc'/'DESC'}*/
|
||||
sortInfo: {fields: [], columns: [], directions: [] },
|
||||
|
||||
//Set the tab index of the Vieport.
|
||||
tabIndex: -1,
|
||||
/*Prevents the internal sorting from executing.
|
||||
The sortInfo object will be updated with the sorting information so you can handle sorting (see sortInfo)*/
|
||||
useExternalSorting: false,
|
||||
|
||||
/*i18n language support. choose from the installed or included languages, en, fr, sp, etc...*/
|
||||
i18n: 'en',
|
||||
|
||||
//the threshold in rows to force virtualization on
|
||||
virtualizationThreshold: 50
|
||||
},
|
||||
self = this;
|
||||
self.maxCanvasHt = 0;
|
||||
//self vars
|
||||
self.config = $.extend(defaults, window.ngGrid.config, options);
|
||||
|
||||
// override conflicting settings
|
||||
self.config.showSelectionCheckbox = (self.config.showSelectionCheckbox && self.config.enableColumnHeavyVirt === false);
|
||||
self.config.enablePinning = (self.config.enablePinning && self.config.enableColumnHeavyVirt === false);
|
||||
self.config.selectWithCheckboxOnly = (self.config.selectWithCheckboxOnly && self.config.showSelectionCheckbox !== false);
|
||||
self.config.pinSelectionCheckbox = self.config.enablePinning;
|
||||
|
||||
if (typeof options.columnDefs == "string") {
|
||||
self.config.columnDefs = $scope.$eval(options.columnDefs);
|
||||
}
|
||||
self.rowCache = [];
|
||||
self.rowMap = [];
|
||||
self.gridId = "ng" + $utils.newId();
|
||||
self.$root = null; //this is the root element that is passed in with the binding handler
|
||||
self.$groupPanel = null;
|
||||
self.$topPanel = null;
|
||||
self.$headerContainer = null;
|
||||
self.$headerScroller = null;
|
||||
self.$headers = null;
|
||||
self.$viewport = null;
|
||||
self.$canvas = null;
|
||||
self.rootDim = self.config.gridDim;
|
||||
self.data = [];
|
||||
self.lateBindColumns = false;
|
||||
self.filteredRows = [];
|
||||
|
||||
//Templates
|
||||
// test templates for urls and get the tempaltes via synchronous ajax calls
|
||||
var getTemplate = function (key) {
|
||||
var t = self.config[key];
|
||||
var uKey = self.gridId + key + ".html";
|
||||
if (t && !TEMPLATE_REGEXP.test(t)) {
|
||||
$templateCache.put(uKey, $.ajax({
|
||||
type: "GET",
|
||||
url: t,
|
||||
async: false
|
||||
}).responseText);
|
||||
} else if (t) {
|
||||
$templateCache.put(uKey, t);
|
||||
} else {
|
||||
var dKey = key + ".html";
|
||||
$templateCache.put(uKey, $templateCache.get(dKey));
|
||||
}
|
||||
};
|
||||
getTemplate('rowTemplate');
|
||||
getTemplate('aggregateTemplate');
|
||||
getTemplate('headerRowTemplate');
|
||||
getTemplate('checkboxCellTemplate');
|
||||
getTemplate('checkboxHeaderTemplate');
|
||||
getTemplate('menuTemplate');
|
||||
getTemplate('footerTemplate');
|
||||
|
||||
if (typeof self.config.data == "object") {
|
||||
self.data = self.config.data; // we cannot watch for updates if you don't pass the string name
|
||||
}
|
||||
self.calcMaxCanvasHeight = function() {
|
||||
return (self.config.groups.length > 0) ? (self.rowFactory.parsedData.filter(function(e) {
|
||||
return !e[NG_HIDDEN];
|
||||
}).length * self.config.rowHeight) : (self.filteredRows.length * self.config.rowHeight);
|
||||
};
|
||||
self.elementDims = {
|
||||
scrollW: 0,
|
||||
scrollH: 0,
|
||||
rowIndexCellW: 25,
|
||||
rowSelectedCellW: 25,
|
||||
rootMaxW: 0,
|
||||
rootMaxH: 0
|
||||
};
|
||||
//self funcs
|
||||
self.setRenderedRows = function (newRows) {
|
||||
$scope.renderedRows.length = newRows.length;
|
||||
for (var i = 0; i < newRows.length; i++) {
|
||||
if (!$scope.renderedRows[i] || (newRows[i].isAggRow || $scope.renderedRows[i].isAggRow)) {
|
||||
$scope.renderedRows[i] = newRows[i].copy();
|
||||
$scope.renderedRows[i].collapsed = newRows[i].collapsed;
|
||||
if (!newRows[i].isAggRow) {
|
||||
$scope.renderedRows[i].setVars(newRows[i]);
|
||||
}
|
||||
} else {
|
||||
$scope.renderedRows[i].setVars(newRows[i]);
|
||||
}
|
||||
$scope.renderedRows[i].rowIndex = newRows[i].rowIndex;
|
||||
$scope.renderedRows[i].offsetTop = newRows[i].offsetTop;
|
||||
newRows[i].renderedRowIndex = i;
|
||||
}
|
||||
self.refreshDomSizes();
|
||||
$scope.$emit('ngGridEventRows', newRows);
|
||||
};
|
||||
self.minRowsToRender = function() {
|
||||
var viewportH = $scope.viewportDimHeight() || 1;
|
||||
return Math.floor(viewportH / self.config.rowHeight);
|
||||
};
|
||||
self.refreshDomSizes = function() {
|
||||
var dim = new ngDimension();
|
||||
dim.outerWidth = self.elementDims.rootMaxW;
|
||||
dim.outerHeight = self.elementDims.rootMaxH;
|
||||
self.rootDim = dim;
|
||||
self.maxCanvasHt = self.calcMaxCanvasHeight();
|
||||
};
|
||||
self.buildColumnDefsFromData = function () {
|
||||
self.config.columnDefs = [];
|
||||
var item = self.data[0];
|
||||
if (!item) {
|
||||
self.lateBoundColumns = true;
|
||||
return;
|
||||
}
|
||||
$utils.forIn(item, function (prop, propName) {
|
||||
if (self.config.excludeProperties.indexOf(propName) == -1) {
|
||||
self.config.columnDefs.push({
|
||||
field: propName
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
self.buildColumns = function() {
|
||||
var columnDefs = self.config.columnDefs,
|
||||
cols = [];
|
||||
if (!columnDefs) {
|
||||
self.buildColumnDefsFromData();
|
||||
columnDefs = self.config.columnDefs;
|
||||
}
|
||||
if (self.config.showSelectionCheckbox) {
|
||||
cols.push(new ngColumn({
|
||||
colDef: {
|
||||
field: '\u2714',
|
||||
width: self.elementDims.rowSelectedCellW,
|
||||
sortable: false,
|
||||
resizable: false,
|
||||
groupable: false,
|
||||
headerCellTemplate: $templateCache.get($scope.gridId + 'checkboxHeaderTemplate.html'),
|
||||
cellTemplate: $templateCache.get($scope.gridId + 'checkboxCellTemplate.html'),
|
||||
pinned: self.config.pinSelectionCheckbox
|
||||
},
|
||||
index: 0,
|
||||
headerRowHeight: self.config.headerRowHeight,
|
||||
sortCallback: self.sortData,
|
||||
resizeOnDataCallback: self.resizeOnData,
|
||||
enableResize: self.config.enableColumnResize,
|
||||
enableSort: self.config.enableSorting
|
||||
}, $scope, self, domUtilityService, $templateCache, $utils));
|
||||
}
|
||||
if (columnDefs.length > 0) {
|
||||
var indexOffset = self.config.showSelectionCheckbox ? self.config.groups.length + 1 : self.config.groups.length;
|
||||
$scope.configGroups.length = 0;
|
||||
angular.forEach(columnDefs, function(colDef, i) {
|
||||
i += indexOffset;
|
||||
var column = new ngColumn({
|
||||
colDef: colDef,
|
||||
index: i,
|
||||
headerRowHeight: self.config.headerRowHeight,
|
||||
sortCallback: self.sortData,
|
||||
resizeOnDataCallback: self.resizeOnData,
|
||||
enableResize: self.config.enableColumnResize,
|
||||
enableSort: self.config.enableSorting,
|
||||
enablePinning: self.config.enablePinning,
|
||||
enableCellEdit: self.config.enableCellEdit
|
||||
}, $scope, self, domUtilityService, $templateCache, $utils);
|
||||
var indx = self.config.groups.indexOf(colDef.field);
|
||||
if (indx != -1) {
|
||||
column.isGroupedBy = true;
|
||||
$scope.configGroups.splice(indx, 0, column);
|
||||
column.groupIndex = $scope.configGroups.length;
|
||||
}
|
||||
cols.push(column);
|
||||
});
|
||||
$scope.columns = cols;
|
||||
}
|
||||
};
|
||||
self.configureColumnWidths = function() {
|
||||
var cols = self.config.columnDefs;
|
||||
var indexOffset = self.config.showSelectionCheckbox ? $scope.configGroups.length + 1 : $scope.configGroups.length;
|
||||
var numOfCols = cols.length + indexOffset,
|
||||
asterisksArray = [],
|
||||
percentArray = [],
|
||||
asteriskNum = 0,
|
||||
totalWidth = 0;
|
||||
totalWidth += self.config.showSelectionCheckbox ? 25 : 0;
|
||||
angular.forEach(cols, function(col, i) {
|
||||
i += indexOffset;
|
||||
var isPercent = false, t = undefined;
|
||||
//if width is not defined, set it to a single star
|
||||
if ($utils.isNullOrUndefined(col.width)) {
|
||||
col.width = "*";
|
||||
} else { // get column width
|
||||
isPercent = isNaN(col.width) ? $utils.endsWith(col.width, "%") : false;
|
||||
t = isPercent ? col.width : parseInt(col.width, 10);
|
||||
}
|
||||
// check if it is a number
|
||||
if (isNaN(t)) {
|
||||
t = col.width;
|
||||
// figure out if the width is defined or if we need to calculate it
|
||||
if (t == 'auto') { // set it for now until we have data and subscribe when it changes so we can set the width.
|
||||
$scope.columns[i].width = col.minWidth;
|
||||
totalWidth += $scope.columns[i].width;
|
||||
var temp = $scope.columns[i];
|
||||
$timeout(function () {
|
||||
self.resizeOnData(temp, true);
|
||||
});
|
||||
return;
|
||||
} else if (t.indexOf("*") != -1) { // we need to save it until the end to do the calulations on the remaining width.
|
||||
if (col.visible !== false) {
|
||||
asteriskNum += t.length;
|
||||
}
|
||||
col.index = i;
|
||||
asterisksArray.push(col);
|
||||
return;
|
||||
} else if (isPercent) { // If the width is a percentage, save it until the very last.
|
||||
col.index = i;
|
||||
percentArray.push(col);
|
||||
return;
|
||||
} else { // we can't parse the width so lets throw an error.
|
||||
throw "unable to parse column width, use percentage (\"10%\",\"20%\", etc...) or \"*\" to use remaining width of grid";
|
||||
}
|
||||
} else if (col.visible !== false) {
|
||||
totalWidth += $scope.columns[i].width = parseInt(col.width, 10);
|
||||
}
|
||||
});
|
||||
// check if we saved any asterisk columns for calculating later
|
||||
if (asterisksArray.length > 0) {
|
||||
self.config.maintainColumnRatios === false ? angular.noop() : self.config.maintainColumnRatios = true;
|
||||
// get the remaining width
|
||||
var remainigWidth = self.rootDim.outerWidth - totalWidth;
|
||||
// calculate the weight of each asterisk rounded down
|
||||
var asteriskVal = Math.floor(remainigWidth / asteriskNum);
|
||||
// set the width of each column based on the number of stars
|
||||
angular.forEach(asterisksArray, function(col) {
|
||||
var t = col.width.length;
|
||||
$scope.columns[col.index].width = asteriskVal * t;
|
||||
//check if we are on the last column
|
||||
if (col.index + 1 == numOfCols) {
|
||||
var offset = 2; //We're going to remove 2 px so we won't overlflow the viwport by default
|
||||
// are we overflowing?
|
||||
if (self.maxCanvasHt > $scope.viewportDimHeight()) {
|
||||
//compensate for scrollbar
|
||||
offset += domUtilityService.ScrollW;
|
||||
}
|
||||
$scope.columns[col.index].width -= offset;
|
||||
}
|
||||
if (col.visible !== false) {
|
||||
totalWidth += $scope.columns[col.index].width;
|
||||
}
|
||||
});
|
||||
}
|
||||
// Now we check if we saved any percentage columns for calculating last
|
||||
if (percentArray.length > 0) {
|
||||
// do the math
|
||||
angular.forEach(percentArray, function(col) {
|
||||
var t = col.width;
|
||||
$scope.columns[col.index].width = Math.floor(self.rootDim.outerWidth * (parseInt(t.slice(0, -1), 10) / 100));
|
||||
});
|
||||
}
|
||||
};
|
||||
self.init = function() {
|
||||
//factories and services
|
||||
$scope.selectionProvider = new ngSelectionProvider(self, $scope, $parse);
|
||||
$scope.domAccessProvider = new ngDomAccessProvider(self);
|
||||
self.rowFactory = new ngRowFactory(self, $scope, domUtilityService, $templateCache, $utils);
|
||||
self.searchProvider = new ngSearchProvider($scope, self, $filter);
|
||||
self.styleProvider = new ngStyleProvider($scope, self, domUtilityService);
|
||||
$scope.$watch('configGroups', function(a) {
|
||||
var tempArr = [];
|
||||
angular.forEach(a, function(item) {
|
||||
tempArr.push(item.field || item);
|
||||
});
|
||||
self.config.groups = tempArr;
|
||||
self.rowFactory.filteredRowsChanged();
|
||||
$scope.$emit('ngGridEventGroups', a);
|
||||
}, true);
|
||||
$scope.$watch('columns', function (a) {
|
||||
domUtilityService.BuildStyles($scope, self, true);
|
||||
$scope.$emit('ngGridEventColumns', a);
|
||||
}, true);
|
||||
$scope.$watch(function() {
|
||||
return options.i18n;
|
||||
}, function(newLang) {
|
||||
$utils.seti18n($scope, newLang);
|
||||
});
|
||||
self.maxCanvasHt = self.calcMaxCanvasHeight();
|
||||
if (self.config.sortInfo.fields && self.config.sortInfo.fields.length > 0) {
|
||||
self.getColsFromFields();
|
||||
self.sortActual();
|
||||
}
|
||||
};
|
||||
|
||||
self.resizeOnData = function(col) {
|
||||
// we calculate the longest data.
|
||||
var longest = col.minWidth;
|
||||
var arr = $utils.getElementsByClassName('col' + col.index);
|
||||
angular.forEach(arr, function(elem, index) {
|
||||
var i;
|
||||
if (index === 0) {
|
||||
var kgHeaderText = $(elem).find('.ngHeaderText');
|
||||
i = $utils.visualLength(kgHeaderText) + 10; // +10 some margin
|
||||
} else {
|
||||
var ngCellText = $(elem).find('.ngCellText');
|
||||
i = $utils.visualLength(ngCellText) + 10; // +10 some margin
|
||||
}
|
||||
if (i > longest) {
|
||||
longest = i;
|
||||
}
|
||||
});
|
||||
col.width = col.longest = Math.min(col.maxWidth, longest + 7); // + 7 px to make it look decent.
|
||||
domUtilityService.BuildStyles($scope, self, true);
|
||||
};
|
||||
self.lastSortedColumns = [];
|
||||
self.changeRowOrder = function(prevRow, targetRow) {
|
||||
// Splice the Rows via the actual datasource
|
||||
var i = self.rowCache.indexOf(prevRow);
|
||||
var j = self.rowCache.indexOf(targetRow);
|
||||
self.rowCache.splice(i, 1);
|
||||
self.rowCache.splice(j, 0, prevRow);
|
||||
$scope.$emit('ngGridEventChangeOrder', self.rowCache);
|
||||
};
|
||||
self.sortData = function(col, evt) {
|
||||
if (evt.shiftKey && self.config.sortInfo) {
|
||||
var indx = self.config.sortInfo.columns.indexOf(col);
|
||||
if (indx === -1) {
|
||||
if (self.config.sortInfo.columns.length == 1) {
|
||||
self.config.sortInfo.columns[0].sortPriority = 1;
|
||||
}
|
||||
self.config.sortInfo.columns.push(col);
|
||||
col.sortPriority = self.config.sortInfo.columns.length;
|
||||
self.config.sortInfo.fields.push(col.field);
|
||||
self.config.sortInfo.directions.push(col.sortDirection);
|
||||
self.lastSortedColumns.push(col);
|
||||
} else {
|
||||
self.config.sortInfo.directions[indx] = col.sortDirection;
|
||||
}
|
||||
} else {
|
||||
var isArr = $.isArray(col);
|
||||
self.config.sortInfo.columns.length = 0;
|
||||
self.config.sortInfo.fields.length = 0;
|
||||
self.config.sortInfo.directions.length = 0;
|
||||
var push = function (c) {
|
||||
self.config.sortInfo.columns.push(c);
|
||||
self.config.sortInfo.fields.push(c.field);
|
||||
self.config.sortInfo.directions.push(c.sortDirection);
|
||||
self.lastSortedColumns.push(c);
|
||||
};
|
||||
if (isArr) {
|
||||
self.clearSortingData();
|
||||
angular.forEach(col, function (c, i) {
|
||||
c.sortPriority = i + 1;
|
||||
push(c);
|
||||
});
|
||||
} else {
|
||||
self.clearSortingData(col);
|
||||
col.sortPriority = undefined;
|
||||
push(col);
|
||||
}
|
||||
}
|
||||
self.sortActual();
|
||||
self.searchProvider.evalFilter();
|
||||
$scope.$emit('ngGridEventSorted', self.config.sortInfo);
|
||||
};
|
||||
self.getColsFromFields = function() {
|
||||
if (self.config.sortInfo.columns) {
|
||||
self.config.sortInfo.columns.length = 0;
|
||||
} else {
|
||||
self.config.sortInfo.columns = [];
|
||||
}
|
||||
angular.forEach($scope.columns, function(c) {
|
||||
var i = self.config.sortInfo.fields.indexOf(c.field);
|
||||
if (i != -1) {
|
||||
c.sortDirection = self.config.sortInfo.directions[i] || 'asc';
|
||||
self.config.sortInfo.columns.push(c);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
self.sortActual = function() {
|
||||
if (!self.config.useExternalSorting) {
|
||||
var tempData = self.data.slice(0);
|
||||
angular.forEach(tempData, function(item, i) {
|
||||
item.preSortSelected = self.rowCache[self.rowMap[i]].selected;
|
||||
item.preSortIndex = i;
|
||||
});
|
||||
sortService.Sort(self.config.sortInfo, tempData);
|
||||
angular.forEach(tempData, function(item, i) {
|
||||
self.rowCache[i].entity = item;
|
||||
self.rowCache[i].selected = item.preSortSelected;
|
||||
self.rowMap[item.preSortIndex] = i;
|
||||
delete item.preSortSelected;
|
||||
delete item.preSortIndex;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
self.clearSortingData = function (col) {
|
||||
if (!col) {
|
||||
angular.forEach(self.lastSortedColumns, function (c) {
|
||||
c.sortDirection = "";
|
||||
c.sortPriority = null;
|
||||
});
|
||||
self.lastSortedColumns = [];
|
||||
} else {
|
||||
angular.forEach(self.lastSortedColumns, function (c) {
|
||||
if (col.index != c.index) {
|
||||
c.sortDirection = "";
|
||||
c.sortPriority = null;
|
||||
}
|
||||
});
|
||||
self.lastSortedColumns[0] = col;
|
||||
self.lastSortedColumns.length = 1;
|
||||
};
|
||||
};
|
||||
self.fixColumnIndexes = function() {
|
||||
//fix column indexes
|
||||
for (var i = 0; i < $scope.columns.length; i++) {
|
||||
if ($scope.columns[i].visible !== false) {
|
||||
$scope.columns[i].index = i;
|
||||
}
|
||||
}
|
||||
};
|
||||
self.fixGroupIndexes = function() {
|
||||
angular.forEach($scope.configGroups, function(item, i) {
|
||||
item.groupIndex = i + 1;
|
||||
});
|
||||
};
|
||||
//$scope vars
|
||||
$scope.elementsNeedMeasuring = true;
|
||||
$scope.columns = [];
|
||||
$scope.renderedRows = [];
|
||||
$scope.renderedColumns = [];
|
||||
$scope.headerRow = null;
|
||||
$scope.rowHeight = self.config.rowHeight;
|
||||
$scope.jqueryUITheme = self.config.jqueryUITheme;
|
||||
$scope.showSelectionCheckbox = self.config.showSelectionCheckbox;
|
||||
$scope.enableCellSelection = self.config.enableCellSelection;
|
||||
$scope.footer = null;
|
||||
$scope.selectedItems = self.config.selectedItems;
|
||||
$scope.multiSelect = self.config.multiSelect;
|
||||
$scope.showFooter = self.config.showFooter;
|
||||
$scope.footerRowHeight = $scope.showFooter ? self.config.footerRowHeight : 0;
|
||||
$scope.showColumnMenu = self.config.showColumnMenu;
|
||||
$scope.showMenu = false;
|
||||
$scope.configGroups = [];
|
||||
$scope.gridId = self.gridId;
|
||||
//Paging
|
||||
$scope.enablePaging = self.config.enablePaging;
|
||||
$scope.pagingOptions = self.config.pagingOptions;
|
||||
|
||||
//i18n support
|
||||
$scope.i18n = {};
|
||||
$utils.seti18n($scope, self.config.i18n);
|
||||
$scope.adjustScrollLeft = function (scrollLeft) {
|
||||
var colwidths = 0,
|
||||
totalLeft = 0,
|
||||
x = $scope.columns.length,
|
||||
newCols = [],
|
||||
dcv = !self.config.enableColumnHeavyVirt;
|
||||
var r = 0;
|
||||
var addCol = function (c) {
|
||||
if (dcv) {
|
||||
newCols.push(c);
|
||||
} else {
|
||||
if (!$scope.renderedColumns[r]) {
|
||||
$scope.renderedColumns[r] = c.copy();
|
||||
} else {
|
||||
$scope.renderedColumns[r].setVars(c);
|
||||
}
|
||||
}
|
||||
r++;
|
||||
};
|
||||
for (var i = 0; i < x; i++) {
|
||||
var col = $scope.columns[i];
|
||||
if (col.visible !== false) {
|
||||
var w = col.width + colwidths;
|
||||
if (col.pinned) {
|
||||
addCol(col);
|
||||
var newLeft = i > 0 ? (scrollLeft + totalLeft) : scrollLeft;
|
||||
domUtilityService.setColLeft(col, newLeft, self);
|
||||
totalLeft += col.width;
|
||||
} else {
|
||||
if (w >= scrollLeft) {
|
||||
if (colwidths <= scrollLeft + self.rootDim.outerWidth) {
|
||||
addCol(col);
|
||||
}
|
||||
}
|
||||
}
|
||||
colwidths += col.width;
|
||||
}
|
||||
}
|
||||
if (dcv) {
|
||||
$scope.renderedColumns = newCols;
|
||||
}
|
||||
};
|
||||
self.prevScrollTop = 0;
|
||||
self.prevScrollIndex = 0;
|
||||
$scope.adjustScrollTop = function(scrollTop, force) {
|
||||
if (self.prevScrollTop === scrollTop && !force) {
|
||||
return;
|
||||
}
|
||||
if (scrollTop > 0 && self.$viewport[0].scrollHeight - scrollTop <= self.$viewport.outerHeight()) {
|
||||
$scope.$emit('ngGridEventScroll');
|
||||
}
|
||||
var rowIndex = Math.floor(scrollTop / self.config.rowHeight);
|
||||
var newRange;
|
||||
if (self.filteredRows.length > self.config.virtualizationThreshold) {
|
||||
// Have we hit the threshold going down?
|
||||
if (self.prevScrollTop < scrollTop && rowIndex < self.prevScrollIndex + SCROLL_THRESHOLD) {
|
||||
return;
|
||||
}
|
||||
//Have we hit the threshold going up?
|
||||
if (self.prevScrollTop > scrollTop && rowIndex > self.prevScrollIndex - SCROLL_THRESHOLD) {
|
||||
return;
|
||||
}
|
||||
newRange = new ngRange(Math.max(0, rowIndex - EXCESS_ROWS), rowIndex + self.minRowsToRender() + EXCESS_ROWS);
|
||||
} else {
|
||||
var maxLen = $scope.configGroups.length > 0 ? self.rowFactory.parsedData.length : self.data.length;
|
||||
newRange = new ngRange(0, Math.max(maxLen, self.minRowsToRender() + EXCESS_ROWS));
|
||||
}
|
||||
self.prevScrollTop = scrollTop;
|
||||
self.rowFactory.UpdateViewableRange(newRange);
|
||||
self.prevScrollIndex = rowIndex;
|
||||
};
|
||||
|
||||
//scope funcs
|
||||
$scope.toggleShowMenu = function() {
|
||||
$scope.showMenu = !$scope.showMenu;
|
||||
};
|
||||
$scope.toggleSelectAll = function(a) {
|
||||
$scope.selectionProvider.toggleSelectAll(a);
|
||||
};
|
||||
$scope.totalFilteredItemsLength = function() {
|
||||
return self.filteredRows.length;
|
||||
};
|
||||
$scope.showGroupPanel = function() {
|
||||
return self.config.showGroupPanel;
|
||||
};
|
||||
$scope.topPanelHeight = function() {
|
||||
return self.config.showGroupPanel === true ? self.config.headerRowHeight + 32 : self.config.headerRowHeight;
|
||||
};
|
||||
|
||||
$scope.viewportDimHeight = function() {
|
||||
return Math.max(0, self.rootDim.outerHeight - $scope.topPanelHeight() - $scope.footerRowHeight - 2);
|
||||
};
|
||||
$scope.groupBy = function (col) {
|
||||
if (self.data.length < 1 || !col.groupable || !col.field) {
|
||||
return;
|
||||
}
|
||||
//first sort the column
|
||||
if (!col.sortDirection) col.sort({ shiftKey: false });
|
||||
|
||||
var indx = $scope.configGroups.indexOf(col);
|
||||
if (indx == -1) {
|
||||
col.isGroupedBy = true;
|
||||
$scope.configGroups.push(col);
|
||||
col.groupIndex = $scope.configGroups.length;
|
||||
} else {
|
||||
$scope.removeGroup(indx);
|
||||
}
|
||||
self.$viewport.scrollTop(0);
|
||||
domUtilityService.digest($scope);
|
||||
};
|
||||
$scope.removeGroup = function(index) {
|
||||
var col = $scope.columns.filter(function(item) {
|
||||
return item.groupIndex == (index + 1);
|
||||
})[0];
|
||||
col.isGroupedBy = false;
|
||||
col.groupIndex = 0;
|
||||
if ($scope.columns[index].isAggCol) {
|
||||
$scope.columns.splice(index, 1);
|
||||
$scope.configGroups.splice(index, 1);
|
||||
self.fixGroupIndexes();
|
||||
}
|
||||
if ($scope.configGroups.length === 0) {
|
||||
self.fixColumnIndexes();
|
||||
domUtilityService.digest($scope);
|
||||
}
|
||||
$scope.adjustScrollLeft(0);
|
||||
};
|
||||
$scope.togglePin = function (col) {
|
||||
var indexFrom = col.index;
|
||||
var indexTo = 0;
|
||||
for (var i = 0; i < $scope.columns.length; i++) {
|
||||
if (!$scope.columns[i].pinned) {
|
||||
break;
|
||||
}
|
||||
indexTo++;
|
||||
}
|
||||
if (col.pinned) {
|
||||
indexTo = Math.max(col.originalIndex, indexTo - 1);
|
||||
}
|
||||
col.pinned = !col.pinned;
|
||||
// Splice the columns
|
||||
$scope.columns.splice(indexFrom, 1);
|
||||
$scope.columns.splice(indexTo, 0, col);
|
||||
self.fixColumnIndexes();
|
||||
// Finally, rebuild the CSS styles.
|
||||
domUtilityService.BuildStyles($scope, self, true);
|
||||
self.$viewport.scrollLeft(self.$viewport.scrollLeft() - col.width);
|
||||
};
|
||||
$scope.totalRowWidth = function() {
|
||||
var totalWidth = 0,
|
||||
cols = $scope.columns;
|
||||
for (var i = 0; i < cols.length; i++) {
|
||||
if (cols[i].visible !== false) {
|
||||
totalWidth += cols[i].width;
|
||||
}
|
||||
}
|
||||
return totalWidth;
|
||||
};
|
||||
$scope.headerScrollerDim = function() {
|
||||
var viewportH = $scope.viewportDimHeight(),
|
||||
maxHeight = self.maxCanvasHt,
|
||||
vScrollBarIsOpen = (maxHeight > viewportH),
|
||||
newDim = new ngDimension();
|
||||
|
||||
newDim.autoFitHeight = true;
|
||||
newDim.outerWidth = $scope.totalRowWidth();
|
||||
if (vScrollBarIsOpen) {
|
||||
newDim.outerWidth += self.elementDims.scrollW;
|
||||
} else if ((maxHeight - viewportH) <= self.elementDims.scrollH) { //if the horizontal scroll is open it forces the viewport to be smaller
|
||||
newDim.outerWidth += self.elementDims.scrollW;
|
||||
}
|
||||
return newDim;
|
||||
};
|
||||
//call init
|
||||
self.init();
|
||||
};
|
|
@ -1,4 +0,0 @@
|
|||
var ngRange = function (top, bottom) {
|
||||
this.topRow = top;
|
||||
this.bottomRow = bottom;
|
||||
};
|
|
@ -1,76 +0,0 @@
|
|||
var ngRow = function (entity, config, selectionProvider, rowIndex, $utils) {
|
||||
var self = this, // constant for the selection property that we add to each data item
|
||||
enableRowSelection = config.enableRowSelection;
|
||||
|
||||
self.jqueryUITheme = config.jqueryUITheme;
|
||||
self.rowClasses = config.rowClasses;
|
||||
self.entity = entity;
|
||||
self.selectionProvider = selectionProvider;
|
||||
self.selected = selectionProvider.getSelection(entity);
|
||||
self.cursor = enableRowSelection ? 'pointer' : 'default';
|
||||
self.setSelection = function(isSelected) {
|
||||
self.selectionProvider.setSelection(self, isSelected);
|
||||
self.selectionProvider.lastClickedRow = self;
|
||||
};
|
||||
self.continueSelection = function(event) {
|
||||
self.selectionProvider.ChangeSelection(self, event);
|
||||
};
|
||||
self.ensureEntity = function(expected) {
|
||||
if (self.entity != expected) {
|
||||
// Update the entity and determine our selected property
|
||||
self.entity = expected;
|
||||
self.selected = self.selectionProvider.getSelection(self.entity);
|
||||
}
|
||||
};
|
||||
self.toggleSelected = function(event) {
|
||||
if (!enableRowSelection && !config.enableCellSelection) {
|
||||
return true;
|
||||
}
|
||||
var element = event.target || event;
|
||||
//check and make sure its not the bubbling up of our checked 'click' event
|
||||
if (element.type == "checkbox" && element.parentElement.className != "ngSelectionCell ng-scope") {
|
||||
return true;
|
||||
}
|
||||
if (config.selectWithCheckboxOnly && element.type != "checkbox") {
|
||||
self.selectionProvider.lastClickedRow = self;
|
||||
return true;
|
||||
} else {
|
||||
if (self.beforeSelectionChange(self, event)) {
|
||||
self.continueSelection(event);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
self.rowIndex = rowIndex;
|
||||
self.offsetTop = self.rowIndex * config.rowHeight;
|
||||
self.rowDisplayIndex = 0;
|
||||
self.alternatingRowClass = function () {
|
||||
var isEven = (self.rowIndex % 2) === 0;
|
||||
var classes = {
|
||||
'ngRow' : true,
|
||||
'selected': self.selected,
|
||||
'even': isEven,
|
||||
'odd': !isEven,
|
||||
'ui-state-default': self.jqueryUITheme && isEven,
|
||||
'ui-state-active': self.jqueryUITheme && !isEven
|
||||
};
|
||||
return classes;
|
||||
};
|
||||
self.beforeSelectionChange = config.beforeSelectionChangeCallback;
|
||||
self.afterSelectionChange = config.afterSelectionChangeCallback;
|
||||
|
||||
self.getProperty = function(path) {
|
||||
return $utils.evalProperty(self.entity, path);
|
||||
};
|
||||
self.copy = function () {
|
||||
self.clone = new ngRow(entity, config, selectionProvider, rowIndex, $utils);
|
||||
self.clone.isClone = true;
|
||||
self.clone.elm = self.elm;
|
||||
return self.clone;
|
||||
};
|
||||
self.setVars = function (fromRow) {
|
||||
fromRow.clone = self;
|
||||
self.entity = fromRow.entity;
|
||||
self.selected = fromRow.selected;
|
||||
};
|
||||
};
|
|
@ -1,240 +0,0 @@
|
|||
var ngRowFactory = function (grid, $scope, domUtilityService, $templateCache, $utils) {
|
||||
var self = this;
|
||||
// we cache rows when they are built, and then blow the cache away when sorting
|
||||
self.aggCache = {};
|
||||
self.parentCache = []; // Used for grouping and is cleared each time groups are calulated.
|
||||
self.dataChanged = true;
|
||||
self.parsedData = [];
|
||||
self.rowConfig = {};
|
||||
self.selectionProvider = $scope.selectionProvider;
|
||||
self.rowHeight = 30;
|
||||
self.numberOfAggregates = 0;
|
||||
self.groupedData = undefined;
|
||||
self.rowHeight = grid.config.rowHeight;
|
||||
self.rowConfig = {
|
||||
enableRowSelection: grid.config.enableRowSelection,
|
||||
rowClasses: grid.config.rowClasses,
|
||||
selectedItems: $scope.selectedItems,
|
||||
selectWithCheckboxOnly: grid.config.selectWithCheckboxOnly,
|
||||
beforeSelectionChangeCallback: grid.config.beforeSelectionChange,
|
||||
afterSelectionChangeCallback: grid.config.afterSelectionChange,
|
||||
jqueryUITheme: grid.config.jqueryUITheme,
|
||||
enableCellSelection: grid.config.enableCellSelection,
|
||||
rowHeight: grid.config.rowHeight
|
||||
};
|
||||
|
||||
self.renderedRange = new ngRange(0, grid.minRowsToRender() + EXCESS_ROWS);
|
||||
|
||||
// @entity - the data item
|
||||
// @rowIndex - the index of the row
|
||||
self.buildEntityRow = function(entity, rowIndex) {
|
||||
// build the row
|
||||
return new ngRow(entity, self.rowConfig, self.selectionProvider, rowIndex, $utils);
|
||||
};
|
||||
|
||||
self.buildAggregateRow = function(aggEntity, rowIndex) {
|
||||
var agg = self.aggCache[aggEntity.aggIndex]; // first check to see if we've already built it
|
||||
if (!agg) {
|
||||
// build the row
|
||||
agg = new ngAggregate(aggEntity, self, self.rowConfig.rowHeight);
|
||||
self.aggCache[aggEntity.aggIndex] = agg;
|
||||
}
|
||||
agg.rowIndex = rowIndex;
|
||||
agg.offsetTop = rowIndex * self.rowConfig.rowHeight;
|
||||
return agg;
|
||||
};
|
||||
self.UpdateViewableRange = function(newRange) {
|
||||
self.renderedRange = newRange;
|
||||
self.renderedChange();
|
||||
};
|
||||
self.filteredRowsChanged = function() {
|
||||
// check for latebound autogenerated columns
|
||||
if (grid.lateBoundColumns && grid.filteredRows.length > 0) {
|
||||
grid.config.columnDefs = undefined;
|
||||
grid.buildColumns();
|
||||
grid.lateBoundColumns = false;
|
||||
$scope.$evalAsync(function() {
|
||||
$scope.adjustScrollLeft(0);
|
||||
});
|
||||
}
|
||||
self.dataChanged = true;
|
||||
if (grid.config.groups.length > 0) {
|
||||
self.getGrouping(grid.config.groups);
|
||||
}
|
||||
self.UpdateViewableRange(self.renderedRange);
|
||||
};
|
||||
|
||||
self.renderedChange = function() {
|
||||
if (!self.groupedData || grid.config.groups.length < 1) {
|
||||
self.renderedChangeNoGroups();
|
||||
grid.refreshDomSizes();
|
||||
return;
|
||||
}
|
||||
self.wasGrouped = true;
|
||||
self.parentCache = [];
|
||||
var x = 0;
|
||||
var temp = self.parsedData.filter(function (e) {
|
||||
if (e.isAggRow) {
|
||||
if (e.parent && e.parent.collapsed) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (!e[NG_HIDDEN]) {
|
||||
e.rowIndex = x++;
|
||||
}
|
||||
return !e[NG_HIDDEN];
|
||||
});
|
||||
self.totalRows = temp.length;
|
||||
var rowArr = [];
|
||||
for (var i = self.renderedRange.topRow; i < self.renderedRange.bottomRow; i++) {
|
||||
if (temp[i]) {
|
||||
temp[i].offsetTop = i * grid.config.rowHeight;
|
||||
rowArr.push(temp[i]);
|
||||
}
|
||||
}
|
||||
grid.setRenderedRows(rowArr);
|
||||
};
|
||||
|
||||
self.renderedChangeNoGroups = function () {
|
||||
var rowArr = [];
|
||||
for (var i = self.renderedRange.topRow; i < self.renderedRange.bottomRow; i++) {
|
||||
if (grid.filteredRows[i]) {
|
||||
grid.filteredRows[i].rowIndex = i;
|
||||
grid.filteredRows[i].offsetTop = i * grid.config.rowHeight;
|
||||
rowArr.push(grid.filteredRows[i]);
|
||||
}
|
||||
}
|
||||
grid.setRenderedRows(rowArr);
|
||||
};
|
||||
|
||||
self.fixRowCache = function () {
|
||||
var newLen = grid.data.length;
|
||||
var diff = newLen - grid.rowCache.length;
|
||||
if (diff < 0) {
|
||||
grid.rowCache.length = grid.rowMap.length = newLen;
|
||||
} else {
|
||||
for (var i = grid.rowCache.length; i < newLen; i++) {
|
||||
grid.rowCache[i] = grid.rowFactory.buildEntityRow(grid.data[i], i);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//magical recursion. it works. I swear it. I figured it out in the shower one day.
|
||||
self.parseGroupData = function(g) {
|
||||
if (g.values) {
|
||||
for (var x = 0; x < g.values.length; x++){
|
||||
// get the last parent in the array because that's where our children want to be
|
||||
self.parentCache[self.parentCache.length - 1].children.push(g.values[x]);
|
||||
//add the row to our return array
|
||||
self.parsedData.push(g.values[x]);
|
||||
}
|
||||
} else {
|
||||
for (var prop in g) {
|
||||
// exclude the meta properties.
|
||||
if (prop == NG_FIELD || prop == NG_DEPTH || prop == NG_COLUMN) {
|
||||
continue;
|
||||
} else if (g.hasOwnProperty(prop)) {
|
||||
//build the aggregate row
|
||||
var agg = self.buildAggregateRow({
|
||||
gField: g[NG_FIELD],
|
||||
gLabel: prop,
|
||||
gDepth: g[NG_DEPTH],
|
||||
isAggRow: true,
|
||||
'_ng_hidden_': false,
|
||||
children: [],
|
||||
aggChildren: [],
|
||||
aggIndex: self.numberOfAggregates,
|
||||
aggLabelFilter: g[NG_COLUMN].aggLabelFilter
|
||||
}, 0);
|
||||
self.numberOfAggregates++;
|
||||
//set the aggregate parent to the parent in the array that is one less deep.
|
||||
agg.parent = self.parentCache[agg.depth - 1];
|
||||
// if we have a parent, set the parent to not be collapsed and append the current agg to its children
|
||||
if (agg.parent) {
|
||||
agg.parent.collapsed = false;
|
||||
agg.parent.aggChildren.push(agg);
|
||||
}
|
||||
// add the aggregate row to the parsed data.
|
||||
self.parsedData.push(agg);
|
||||
// the current aggregate now the parent of the current depth
|
||||
self.parentCache[agg.depth] = agg;
|
||||
// dig deeper for more aggregates or children.
|
||||
self.parseGroupData(g[prop]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
//Shuffle the data into their respective groupings.
|
||||
self.getGrouping = function(groups) {
|
||||
self.aggCache = [];
|
||||
self.numberOfAggregates = 0;
|
||||
self.groupedData = {};
|
||||
// Here we set the onmousedown event handler to the header container.
|
||||
var rows = grid.filteredRows,
|
||||
maxDepth = groups.length,
|
||||
cols = $scope.columns;
|
||||
|
||||
for (var x = 0; x < rows.length; x++){
|
||||
var model = rows[x].entity;
|
||||
if (!model) return;
|
||||
rows[x][NG_HIDDEN] = true;
|
||||
var ptr = self.groupedData;
|
||||
for (var y = 0; y < groups.length; y++) {
|
||||
var group = groups[y];
|
||||
var col = cols.filter(function(c) {
|
||||
return c.field == group;
|
||||
})[0];
|
||||
var val = $utils.evalProperty(model, group);
|
||||
val = val ? val.toString() : 'null';
|
||||
if (!ptr[val]) {
|
||||
ptr[val] = {};
|
||||
}
|
||||
if (!ptr[NG_FIELD]) {
|
||||
ptr[NG_FIELD] = group;
|
||||
}
|
||||
if (!ptr[NG_DEPTH]) {
|
||||
ptr[NG_DEPTH] = y;
|
||||
}
|
||||
if (!ptr[NG_COLUMN]) {
|
||||
ptr[NG_COLUMN] = col;
|
||||
}
|
||||
ptr = ptr[val];
|
||||
}
|
||||
if (!ptr.values) {
|
||||
ptr.values = [];
|
||||
}
|
||||
ptr.values.push(rows[x]);
|
||||
};
|
||||
//moved out of above loops due to if no data initially, but has initial grouping, columns won't be added
|
||||
for (var z = 0; z < groups.length; z++) {
|
||||
if (!cols[z].isAggCol && z <= maxDepth) {
|
||||
cols.splice(0, 0, new ngColumn({
|
||||
colDef: {
|
||||
field: '',
|
||||
width: 25,
|
||||
sortable: false,
|
||||
resizable: false,
|
||||
headerCellTemplate: '<div class="ngAggHeader"></div>',
|
||||
pinned: grid.config.pinSelectionCheckbox
|
||||
|
||||
},
|
||||
enablePinning: grid.config.enablePinning,
|
||||
isAggCol: true,
|
||||
headerRowHeight: grid.config.headerRowHeight,
|
||||
|
||||
}, $scope, grid, domUtilityService, $templateCache, $utils));
|
||||
}
|
||||
}
|
||||
domUtilityService.BuildStyles($scope, grid, true);
|
||||
grid.fixColumnIndexes();
|
||||
$scope.adjustScrollLeft(0);
|
||||
self.parsedData.length = 0;
|
||||
self.parseGroupData(self.groupedData);
|
||||
self.fixRowCache();
|
||||
};
|
||||
|
||||
if (grid.config.groups.length > 0 && grid.filteredRows.length > 0) {
|
||||
self.getGrouping(grid.config.groups);
|
||||
}
|
||||
};
|
|
@ -1,159 +0,0 @@
|
|||
var ngSearchProvider = function ($scope, grid, $filter) {
|
||||
var self = this,
|
||||
searchConditions = [];
|
||||
self.extFilter = grid.config.filterOptions.useExternalFilter;
|
||||
$scope.showFilter = grid.config.showFilter;
|
||||
$scope.filterText = '';
|
||||
|
||||
self.fieldMap = {};
|
||||
|
||||
self.evalFilter = function () {
|
||||
var filterFunc = function(item) {
|
||||
for (var x = 0, len = searchConditions.length; x < len; x++) {
|
||||
var condition = searchConditions[x];
|
||||
//Search entire row
|
||||
var result;
|
||||
if (!condition.column) {
|
||||
for (var prop in item) {
|
||||
if (item.hasOwnProperty(prop)) {
|
||||
var c = self.fieldMap[prop];
|
||||
if (!c)
|
||||
continue;
|
||||
var f = null,
|
||||
s = null;
|
||||
if (c && c.cellFilter) {
|
||||
s = c.cellFilter.split(':');
|
||||
f = $filter(s[0]);
|
||||
}
|
||||
var pVal = item[prop];
|
||||
if (pVal != null) {
|
||||
if (typeof f == 'function') {
|
||||
var filterRes = f(typeof pVal === 'object' ? evalObject(pVal, c.field) : pVal, s[1]).toString();
|
||||
result = condition.regex.test(filterRes);
|
||||
} else {
|
||||
result = condition.regex.test(typeof pVal === 'object' ? evalObject(pVal, c.field).toString() : pVal.toString());
|
||||
}
|
||||
if (pVal && result) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//Search by column.
|
||||
var col = self.fieldMap[condition.columnDisplay];
|
||||
if (!col) {
|
||||
return false;
|
||||
}
|
||||
var sp = col.cellFilter.split(':');
|
||||
var filter = col.cellFilter ? $filter(sp[0]) : null;
|
||||
var value = item[condition.column] || item[col.field.split('.')[0]];
|
||||
if (value == null)
|
||||
return false;
|
||||
if (typeof filter == 'function') {
|
||||
var filterResults = filter(typeof value === 'object' ? evalObject(value, col.field) : value, sp[1]).toString();
|
||||
result = condition.regex.test(filterResults);
|
||||
} else {
|
||||
result = condition.regex.test(typeof value === 'object' ? evalObject(value, col.field).toString() : value.toString());
|
||||
}
|
||||
if (!value || !result) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
if (searchConditions.length === 0) {
|
||||
grid.filteredRows = grid.rowCache;
|
||||
} else {
|
||||
grid.filteredRows = grid.rowCache.filter(function(row) {
|
||||
return filterFunc(row.entity);
|
||||
});
|
||||
}
|
||||
for (var i = 0; i < grid.filteredRows.length; i++)
|
||||
{
|
||||
grid.filteredRows[i].rowIndex = i;
|
||||
|
||||
}
|
||||
grid.rowFactory.filteredRowsChanged();
|
||||
};
|
||||
|
||||
//Traversing through the object to find the value that we want. If fail, then return the original object.
|
||||
var evalObject = function (obj, columnName) {
|
||||
if (typeof obj != 'object' || typeof columnName != 'string')
|
||||
return obj;
|
||||
var args = columnName.split('.');
|
||||
var cObj = obj;
|
||||
if (args.length > 1) {
|
||||
for (var i = 1, len = args.length; i < len; i++) {
|
||||
cObj = cObj[args[i]];
|
||||
if (!cObj)
|
||||
return obj;
|
||||
}
|
||||
return cObj;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
var getRegExp = function (str, modifiers) {
|
||||
try {
|
||||
return new RegExp(str, modifiers);
|
||||
} catch (err) {
|
||||
//Escape all RegExp metacharacters.
|
||||
return new RegExp(str.replace(/(\^|\$|\(|\)|\<|\>|\[|\]|\{|\}|\\|\||\.|\*|\+|\?)/g, '\\$1'));
|
||||
}
|
||||
};
|
||||
var buildSearchConditions = function (a) {
|
||||
//reset.
|
||||
searchConditions = [];
|
||||
var qStr;
|
||||
if (!(qStr = $.trim(a))) {
|
||||
return;
|
||||
}
|
||||
var columnFilters = qStr.split(";");
|
||||
for (var i = 0; i < columnFilters.length; i++) {
|
||||
var args = columnFilters[i].split(':');
|
||||
if (args.length > 1) {
|
||||
var columnName = $.trim(args[0]);
|
||||
var columnValue = $.trim(args[1]);
|
||||
if (columnName && columnValue) {
|
||||
searchConditions.push({
|
||||
column: columnName,
|
||||
columnDisplay: columnName.replace(/\s+/g, '').toLowerCase(),
|
||||
regex: getRegExp(columnValue, 'i')
|
||||
});
|
||||
}
|
||||
} else {
|
||||
var val = $.trim(args[0]);
|
||||
if (val) {
|
||||
searchConditions.push({
|
||||
column: '',
|
||||
regex: getRegExp(val, 'i')
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
$scope.$watch(function() {
|
||||
return grid.config.filterOptions.filterText;
|
||||
}, function(a){
|
||||
$scope.filterText = a;
|
||||
});
|
||||
$scope.$watch('filterText', function(a){
|
||||
if(!self.extFilter){
|
||||
$scope.$emit('ngGridEventFilter', a);
|
||||
buildSearchConditions(a);
|
||||
self.evalFilter();
|
||||
}
|
||||
});
|
||||
if (!self.extFilter) {
|
||||
$scope.$watch('columns', function (cs) {
|
||||
for (var i = 0; i < cs.length; i++) {
|
||||
var col = cs[i];
|
||||
if(col.field)
|
||||
self.fieldMap[col.field.split('.')[0]] = col;
|
||||
if(col.displayName)
|
||||
self.fieldMap[col.displayName.toLowerCase().replace(/\s+/g, '')] = col;
|
||||
};
|
||||
});
|
||||
}
|
||||
};
|
|
@ -1,142 +0,0 @@
|
|||
var ngSelectionProvider = function (grid, $scope, $parse) {
|
||||
var self = this;
|
||||
self.multi = grid.config.multiSelect;
|
||||
self.selectedItems = grid.config.selectedItems;
|
||||
self.selectedIndex = grid.config.selectedIndex;
|
||||
self.lastClickedRow = undefined;
|
||||
self.ignoreSelectedItemChanges = false; // flag to prevent circular event loops keeping single-select var in sync
|
||||
self.pKeyParser = $parse(grid.config.primaryKey);
|
||||
// function to manage the selection action of a data item (entity)
|
||||
self.ChangeSelection = function (rowItem, evt) {
|
||||
// ctrl-click + shift-click multi-selections
|
||||
if (evt && !evt.ctrlKey && !evt.shiftKey && evt.originalEvent.constructor.name == "MouseEvent") {
|
||||
self.toggleSelectAll(false, true);
|
||||
}
|
||||
if (evt && evt.shiftKey && !evt.keyCode && self.multi && grid.config.enableRowSelection) {
|
||||
if (self.lastClickedRow) {
|
||||
var rowsArr;
|
||||
if ($scope.configGroups.length > 0) {
|
||||
rowsArr = grid.rowFactory.parsedData.filter(function(row) {
|
||||
return !row.isAggRow;
|
||||
});
|
||||
} else {
|
||||
rowsArr = grid.filteredRows;
|
||||
}
|
||||
var thisIndx = rowItem.rowIndex;
|
||||
var prevIndx = self.lastClickedRow.rowIndex;
|
||||
self.lastClickedRow = rowItem;
|
||||
if (thisIndx == prevIndx) {
|
||||
return false;
|
||||
}
|
||||
if (thisIndx < prevIndx) {
|
||||
thisIndx = thisIndx ^ prevIndx;
|
||||
prevIndx = thisIndx ^ prevIndx;
|
||||
thisIndx = thisIndx ^ prevIndx;
|
||||
thisIndx--;
|
||||
} else {
|
||||
prevIndx++;
|
||||
}
|
||||
var rows = [];
|
||||
for (; prevIndx <= thisIndx; prevIndx++) {
|
||||
rows.push(rowsArr[prevIndx]);
|
||||
}
|
||||
if (rows[rows.length - 1].beforeSelectionChange(rows, evt)) {
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
var ri = rows[i];
|
||||
var selectionState = ri.selected;
|
||||
ri.selected = !selectionState;
|
||||
if (ri.clone) {
|
||||
ri.clone.selected = ri.selected;
|
||||
}
|
||||
var index = self.selectedItems.indexOf(ri.entity);
|
||||
if (index === -1) {
|
||||
self.selectedItems.push(ri.entity);
|
||||
} else {
|
||||
self.selectedItems.splice(index, 1);
|
||||
}
|
||||
}
|
||||
rows[rows.length - 1].afterSelectionChange(rows, evt);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} else if (!self.multi) {
|
||||
if (self.lastClickedRow == rowItem) {
|
||||
self.setSelection(self.lastClickedRow, grid.config.keepLastSelected ? true : !rowItem.selected);
|
||||
} else {
|
||||
if (self.lastClickedRow) {
|
||||
self.setSelection(self.lastClickedRow, false);
|
||||
}
|
||||
self.setSelection(rowItem, !rowItem.selected);
|
||||
}
|
||||
} else if (!evt.keyCode) {
|
||||
self.setSelection(rowItem, !rowItem.selected);
|
||||
}
|
||||
self.lastClickedRow = rowItem;
|
||||
return true;
|
||||
};
|
||||
|
||||
self.getSelection = function (entity) {
|
||||
var isSelected = false;
|
||||
if (grid.config.primaryKey) {
|
||||
var val = self.pKeyParser(entity);
|
||||
angular.forEach(self.selectedItems, function (c) {
|
||||
if (val == self.pkeyParser(c)) {
|
||||
isSelected = true;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
isSelected = self.selectedItems.indexOf(entity) !== -1;
|
||||
}
|
||||
return isSelected;
|
||||
};
|
||||
|
||||
// just call this func and hand it the rowItem you want to select (or de-select)
|
||||
self.setSelection = function (rowItem, isSelected) {
|
||||
if(grid.config.enableRowSelection){
|
||||
rowItem.selected = isSelected;
|
||||
if (rowItem.clone) {
|
||||
rowItem.clone.selected = isSelected;
|
||||
}
|
||||
if (!isSelected) {
|
||||
var indx = self.selectedItems.indexOf(rowItem.entity);
|
||||
if(indx != -1){
|
||||
self.selectedItems.splice(indx, 1);
|
||||
}
|
||||
} else {
|
||||
if (self.selectedItems.indexOf(rowItem.entity) === -1) {
|
||||
if(!self.multi && self.selectedItems.length > 0){
|
||||
self.toggleSelectAll(false, true);
|
||||
rowItem.selected = isSelected;
|
||||
if (rowItem.clone) {
|
||||
rowItem.clone.selected = isSelected;
|
||||
}
|
||||
}
|
||||
self.selectedItems.push(rowItem.entity);
|
||||
}
|
||||
}
|
||||
rowItem.afterSelectionChange(rowItem);
|
||||
}
|
||||
};
|
||||
// @return - boolean indicating if all items are selected or not
|
||||
// @val - boolean indicating whether to select all/de-select all
|
||||
self.toggleSelectAll = function (checkAll, bypass) {
|
||||
if (bypass || grid.config.beforeSelectionChange(grid.filteredRows)) {
|
||||
var selectedlength = self.selectedItems.length;
|
||||
if (selectedlength > 0) {
|
||||
self.selectedItems.length = 0;
|
||||
}
|
||||
for (var i = 0; i < grid.filteredRows.length; i++) {
|
||||
grid.filteredRows[i].selected = checkAll;
|
||||
if (grid.filteredRows[i].clone) {
|
||||
grid.filteredRows[i].clone.selected = checkAll;
|
||||
}
|
||||
if (checkAll) {
|
||||
self.selectedItems.push(grid.filteredRows[i].entity);
|
||||
}
|
||||
}
|
||||
if (!bypass) {
|
||||
grid.config.afterSelectionChange(grid.filteredRows);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
|
@ -1,29 +0,0 @@
|
|||
var ngStyleProvider = function($scope, grid, domUtilityService) {
|
||||
$scope.headerCellStyle = function(col) {
|
||||
return { "height": col.headerRowHeight + "px" };
|
||||
};
|
||||
$scope.rowStyle = function(row) {
|
||||
return { "top": row.offsetTop + "px", "height": $scope.rowHeight + "px" };
|
||||
};
|
||||
$scope.canvasStyle = function() {
|
||||
return { "height": grid.maxCanvasHt.toString() + "px" };
|
||||
};
|
||||
$scope.headerScrollerStyle = function() {
|
||||
return { "height": grid.config.headerRowHeight + "px" };
|
||||
};
|
||||
$scope.topPanelStyle = function() {
|
||||
return { "width": grid.rootDim.outerWidth + "px", "height": $scope.topPanelHeight() + "px" };
|
||||
};
|
||||
$scope.headerStyle = function() {
|
||||
return { "width": (grid.rootDim.outerWidth) + "px", "height": grid.config.headerRowHeight + "px" };
|
||||
};
|
||||
$scope.groupPanelStyle = function () {
|
||||
return { "width": (grid.rootDim.outerWidth) + "px", "height": "32px" };
|
||||
};
|
||||
$scope.viewportStyle = function() {
|
||||
return { "width": grid.rootDim.outerWidth + "px", "height": $scope.viewportDimHeight() + "px" };
|
||||
};
|
||||
$scope.footerStyle = function() {
|
||||
return { "width": grid.rootDim.outerWidth + "px", "height": $scope.footerRowHeight + "px" };
|
||||
};
|
||||
};
|
|
@ -1,16 +0,0 @@
|
|||
// the # of rows we want to add to the top and bottom of the rendered grid rows
|
||||
var EXCESS_ROWS = 6;
|
||||
var SCROLL_THRESHOLD = 4;
|
||||
var ASC = "asc";
|
||||
// constant for sorting direction
|
||||
var DESC = "desc";
|
||||
// constant for sorting direction
|
||||
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 COL_FIELD = /COL_FIELD/g;
|
||||
var DISPLAY_CELL_TEMPLATE = /DISPLAY_CELL_TEMPLATE/g;
|
||||
var EDITABLE_CELL_TEMPLATE = /EDITABLE_CELL_TEMPLATE/g;
|
||||
var TEMPLATE_REGEXP = /<.+>/;
|
|
@ -1,47 +0,0 @@
|
|||
ngGridDirectives.directive('ngCellHasFocus', ['$domUtilityService',
|
||||
function (domUtilityService) {
|
||||
var focusOnInputElement = function($scope, elm){
|
||||
$scope.isFocused = true;
|
||||
domUtilityService.digest($scope);
|
||||
var elementWithoutComments = angular.element(elm[0].children).filter(function () { return this.nodeType != 8; });//Remove html comments for IE8
|
||||
var inputElement = angular.element(elementWithoutComments[0].children[0]);
|
||||
if(inputElement.length > 0){
|
||||
angular.element(inputElement).focus();
|
||||
$scope.domAccessProvider.selectInputElement(inputElement[0]);
|
||||
angular.element(inputElement).bind('blur', function(){
|
||||
$scope.isFocused = false;
|
||||
domUtilityService.digest($scope);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
};
|
||||
return function($scope, elm) {
|
||||
var isFocused = false;
|
||||
$scope.editCell = function(){
|
||||
setTimeout(function() {
|
||||
focusOnInputElement($scope,elm);
|
||||
}, 0);
|
||||
};
|
||||
elm.bind('mousedown', function(){
|
||||
elm.focus();
|
||||
return true;
|
||||
});
|
||||
elm.bind('focus', function(){
|
||||
isFocused = true;
|
||||
return true;
|
||||
});
|
||||
elm.bind('blur', function(){
|
||||
isFocused = false;
|
||||
return true;
|
||||
});
|
||||
elm.bind('keydown', function(evt){
|
||||
if(isFocused && evt.keyCode != 37 && evt.keyCode != 38 && evt.keyCode != 39 && evt.keyCode != 40 && evt.keyCode != 9 && !evt.shiftKey && evt.keyCode != 13){
|
||||
focusOnInputElement($scope,elm);
|
||||
}
|
||||
if(evt.keyCode == 27){
|
||||
elm.focus();
|
||||
}
|
||||
return true;
|
||||
});
|
||||
};
|
||||
}]);
|
|
@ -1,17 +0,0 @@
|
|||
ngGridDirectives.directive('ngCellText',
|
||||
function () {
|
||||
return function(scope, elm) {
|
||||
elm.bind('mouseover', function(evt) {
|
||||
evt.preventDefault();
|
||||
elm.css({
|
||||
'cursor': 'text'
|
||||
});
|
||||
});
|
||||
elm.bind('mouseleave', function(evt) {
|
||||
evt.preventDefault();
|
||||
elm.css({
|
||||
'cursor': 'default'
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
|
@ -1,36 +0,0 @@
|
|||
ngGridDirectives.directive('ngCell', ['$compile', '$domUtilityService', function ($compile, domUtilityService) {
|
||||
var ngCell = {
|
||||
scope: false,
|
||||
compile: function() {
|
||||
return {
|
||||
pre: function($scope, iElement) {
|
||||
var html;
|
||||
var cellTemplate = $scope.col.cellTemplate.replace(COL_FIELD, '$eval(\'row.entity.\' + col.field)');
|
||||
if($scope.col.enableCellEdit){
|
||||
html = $scope.col.cellEditTemplate;
|
||||
html = html.replace(DISPLAY_CELL_TEMPLATE, cellTemplate);
|
||||
html = html.replace(EDITABLE_CELL_TEMPLATE, $scope.col.editableCellTemplate.replace(COL_FIELD, "col.field"));
|
||||
} else {
|
||||
html = cellTemplate;
|
||||
}
|
||||
var cellElement = $compile(html)($scope);
|
||||
if($scope.enableCellSelection && cellElement[0].className.indexOf('ngSelectionCell') == -1){
|
||||
cellElement[0].setAttribute('tabindex', 0);
|
||||
cellElement.addClass('ngCellElement');
|
||||
}
|
||||
iElement.append(cellElement);
|
||||
},
|
||||
post: function($scope, iElement){
|
||||
if($scope.enableCellSelection){
|
||||
$scope.domAccessProvider.selectionHandlers($scope, iElement);
|
||||
}
|
||||
|
||||
$scope.$on('ngGridEventDigestCell', function(){
|
||||
domUtilityService.digest($scope);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
return ngCell;
|
||||
}]);
|
|
@ -1,15 +0,0 @@
|
|||
ngGridDirectives.directive('ngGridFooter', ['$compile', '$templateCache', function ($compile, $templateCache) {
|
||||
var ngGridFooter = {
|
||||
scope: false,
|
||||
compile: function () {
|
||||
return {
|
||||
pre: function ($scope, iElement) {
|
||||
if (iElement.children().length === 0) {
|
||||
iElement.append($compile($templateCache.get($scope.gridId + 'footerTemplate.html'))($scope));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
return ngGridFooter;
|
||||
}]);
|
|
@ -1,15 +0,0 @@
|
|||
ngGridDirectives.directive('ngGridMenu', ['$compile', '$templateCache', function ($compile, $templateCache) {
|
||||
var ngGridMenu = {
|
||||
scope: false,
|
||||
compile: function () {
|
||||
return {
|
||||
pre: function ($scope, iElement) {
|
||||
if (iElement.children().length === 0) {
|
||||
iElement.append($compile($templateCache.get($scope.gridId + 'menuTemplate.html'))($scope));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
return ngGridMenu;
|
||||
}]);
|
|
@ -1,146 +0,0 @@
|
|||
ngGridDirectives.directive('ngGrid', ['$compile', '$filter', '$templateCache', '$sortService', '$domUtilityService', '$utilityService', '$timeout', '$parse', function ($compile, $filter, $templateCache, sortService, domUtilityService, $utils, $timeout, $parse) {
|
||||
var ngGridDirective = {
|
||||
scope: true,
|
||||
compile: function() {
|
||||
return {
|
||||
pre: function($scope, iElement, iAttrs) {
|
||||
var $element = $(iElement);
|
||||
var options = $scope.$eval(iAttrs.ngGrid);
|
||||
options.gridDim = new ngDimension({ outerHeight: $($element).height(), outerWidth: $($element).width() });
|
||||
var grid = new ngGrid($scope, options, sortService, domUtilityService, $filter, $templateCache, $utils, $timeout, $parse);
|
||||
|
||||
// if columndefs are a string of a property ont he scope watch for changes and rebuild columns.
|
||||
if (typeof options.columnDefs == "string") {
|
||||
$scope.$parent.$watch(options.columnDefs, function (a) {
|
||||
if (!a) {
|
||||
grid.refreshDomSizes();
|
||||
grid.buildColumns();
|
||||
return;
|
||||
}
|
||||
// we have to set this to false in case we want to autogenerate columns with no initial data.
|
||||
grid.lateBoundColumns = false;
|
||||
$scope.columns = [];
|
||||
grid.config.columnDefs = a;
|
||||
grid.buildColumns();
|
||||
grid.configureColumnWidths();
|
||||
grid.eventProvider.assignEvents();
|
||||
domUtilityService.RebuildGrid($scope, grid);
|
||||
});
|
||||
} else {
|
||||
grid.buildColumns();
|
||||
}
|
||||
|
||||
// if it is a string we can watch for data changes. otherwise you won't be able to update the grid data
|
||||
if (typeof options.data == "string") {
|
||||
var dataWatcher = function (a) {
|
||||
// make a temporary copy of the data
|
||||
grid.data = $.extend([], a);
|
||||
grid.rowFactory.fixRowCache();
|
||||
angular.forEach(grid.data, function (item, j) {
|
||||
var indx = grid.rowMap[j] || j;
|
||||
if (grid.rowCache[indx]) {
|
||||
grid.rowCache[indx].ensureEntity(item);
|
||||
}
|
||||
grid.rowMap[indx] = j;
|
||||
});
|
||||
grid.searchProvider.evalFilter();
|
||||
grid.configureColumnWidths();
|
||||
grid.refreshDomSizes();
|
||||
if (grid.config.sortInfo.fields.length > 0) {
|
||||
grid.getColsFromFields();
|
||||
grid.sortActual();
|
||||
grid.searchProvider.evalFilter();
|
||||
$scope.$emit('ngGridEventSorted', grid.config.sortInfo);
|
||||
}
|
||||
$scope.$emit("ngGridEventData", grid.gridId);
|
||||
};
|
||||
$scope.$parent.$watch(options.data, dataWatcher);
|
||||
$scope.$parent.$watch(options.data + '.length', function() {
|
||||
dataWatcher($scope.$eval(options.data));
|
||||
});
|
||||
}
|
||||
|
||||
grid.footerController = new ngFooter($scope, grid);
|
||||
//set the right styling on the container
|
||||
iElement.addClass("ngGrid").addClass(grid.gridId.toString());
|
||||
if (!options.enableHighlighting) {
|
||||
iElement.addClass("unselectable");
|
||||
}
|
||||
if (options.jqueryUITheme) {
|
||||
iElement.addClass('ui-widget');
|
||||
}
|
||||
iElement.append($compile($templateCache.get('gridTemplate.html'))($scope)); // make sure that if any of these change, we re-fire the calc logic
|
||||
//walk the element's graph and the correct properties on the grid
|
||||
domUtilityService.AssignGridContainers($scope, iElement, grid);
|
||||
//now use the manager to assign the event handlers
|
||||
grid.eventProvider = new ngEventProvider(grid, $scope, domUtilityService, $timeout);
|
||||
|
||||
// method for user to select a specific row programatically
|
||||
options.selectRow = function (rowIndex, state) {
|
||||
if (grid.rowCache[rowIndex]) {
|
||||
if (grid.rowCache[rowIndex].clone) {
|
||||
grid.rowCache[rowIndex].clone.setSelection(state ? true : false);
|
||||
}
|
||||
grid.rowCache[rowIndex].setSelection(state ? true : false);
|
||||
}
|
||||
};
|
||||
// method for user to select the row by data item programatically
|
||||
options.selectItem = function (itemIndex, state) {
|
||||
options.selectRow(grid.rowMap[itemIndex], state);
|
||||
};
|
||||
// method for user to set the select all state.
|
||||
options.selectAll = function (state) {
|
||||
$scope.toggleSelectAll(state);
|
||||
};
|
||||
// method for user to set the groups programatically
|
||||
options.groupBy = function (field) {
|
||||
if (field) {
|
||||
$scope.groupBy($scope.columns.filter(function(c) {
|
||||
return c.field == field;
|
||||
})[0]);
|
||||
} else {
|
||||
var arr = $.extend(true, [], $scope.configGroups);
|
||||
angular.forEach(arr, $scope.groupBy);
|
||||
}
|
||||
};
|
||||
// method for user to set the sort field programatically
|
||||
options.sortBy = function (field) {
|
||||
var col = $scope.columns.filter(function (c) {
|
||||
return c.field == field;
|
||||
})[0];
|
||||
if (col) col.sort();
|
||||
};
|
||||
// the grid Id, entity, scope for convenience
|
||||
options.gridId = grid.gridId;
|
||||
options.ngGrid = grid;
|
||||
options.$gridScope = $scope;
|
||||
$scope.$on('ngGridEventDigestGrid', function(){
|
||||
domUtilityService.digest($scope.$parent);
|
||||
});
|
||||
|
||||
$scope.$on('ngGridEventDigestGridParent', function(){
|
||||
domUtilityService.digest($scope.$parent);
|
||||
});
|
||||
// set up the columns
|
||||
$scope.$evalAsync(function() {
|
||||
$scope.adjustScrollLeft(0);
|
||||
});
|
||||
//initialize plugins.
|
||||
angular.forEach(options.plugins, function (p) {
|
||||
if (typeof p === 'function') {
|
||||
p = p.call(this);
|
||||
}
|
||||
p.init($scope.$new(), grid, { SortService: sortService, DomUtilityService: domUtilityService });
|
||||
options.plugins[$utils.getInstanceType(p)] = p;
|
||||
});
|
||||
//send initi finalize notification.
|
||||
if (options.init == "function") {
|
||||
options.init(grid, $scope);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
return ngGridDirective;
|
||||
}]);
|
|
@ -1,13 +0,0 @@
|
|||
ngGridDirectives.directive('ngHeaderCell', ['$compile', function($compile) {
|
||||
var ngHeaderCell = {
|
||||
scope: false,
|
||||
compile: function() {
|
||||
return {
|
||||
pre: function($scope, iElement) {
|
||||
iElement.append($compile($scope.col.headerCellTemplate)($scope));
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
return ngHeaderCell;
|
||||
}]);
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* Defines the ui-if tag. This removes/adds an element from the dom depending on a condition
|
||||
* Originally created by @tigbro, for the @jquery-mobile-angular-adapter
|
||||
* https://github.com/tigbro/jquery-mobile-angular-adapter
|
||||
*/
|
||||
ngGridDirectives.directive('ngIf', [function () {
|
||||
return {
|
||||
transclude: 'element',
|
||||
priority: 1000,
|
||||
terminal: true,
|
||||
restrict: 'A',
|
||||
compile: function (e, a, transclude) {
|
||||
return function (scope, element, attr) {
|
||||
|
||||
var childElement;
|
||||
var childScope;
|
||||
|
||||
scope.$watch(attr['ngIf'], function (newValue) {
|
||||
if (childElement) {
|
||||
childElement.remove();
|
||||
childElement = undefined;
|
||||
}
|
||||
if (childScope) {
|
||||
childScope.$destroy();
|
||||
childScope = undefined;
|
||||
}
|
||||
|
||||
if (newValue) {
|
||||
childScope = scope.$new();
|
||||
transclude(childScope, function (clone) {
|
||||
childElement = clone;
|
||||
element.after(clone);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
}]);
|
|
@ -1,35 +0,0 @@
|
|||
ngGridDirectives.directive('ngInput',['$parse', function($parse) {
|
||||
return function ($scope, elm, attrs) {
|
||||
var getter = $parse($scope.$eval(attrs.ngInput));
|
||||
var setter = getter.assign;
|
||||
var oldCellValue = getter($scope.row.entity);
|
||||
elm.val(oldCellValue);
|
||||
elm.bind('keyup', function() {
|
||||
var newVal = elm.val();
|
||||
if (!$scope.$root.$$phase) {
|
||||
$scope.$apply(function(){setter($scope.row.entity,newVal); });
|
||||
}
|
||||
});
|
||||
elm.bind('keydown', function(evt){
|
||||
switch(evt.keyCode){
|
||||
case 37:
|
||||
case 38:
|
||||
case 39:
|
||||
case 40:
|
||||
evt.stopPropagation();
|
||||
break;
|
||||
case 27:
|
||||
if (!$scope.$root.$$phase) {
|
||||
$scope.$apply(function(){
|
||||
setter($scope.row.entity,oldCellValue);
|
||||
elm.val(oldCellValue);
|
||||
elm.blur();
|
||||
});
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
};
|
||||
}]);
|
|
@ -1,30 +0,0 @@
|
|||
ngGridDirectives.directive('ngRow', ['$compile', '$domUtilityService', '$templateCache', function ($compile, domUtilityService, $templateCache) {
|
||||
var ngRow = {
|
||||
scope: false,
|
||||
compile: function() {
|
||||
return {
|
||||
pre: function($scope, iElement) {
|
||||
$scope.row.elm = iElement;
|
||||
if ($scope.row.clone) {
|
||||
$scope.row.clone.elm = iElement;
|
||||
}
|
||||
if ($scope.row.isAggRow) {
|
||||
var html = $templateCache.get($scope.gridId + 'aggregateTemplate.html');
|
||||
if ($scope.row.aggLabelFilter) {
|
||||
html = html.replace(CUSTOM_FILTERS, '| ' + $scope.row.aggLabelFilter);
|
||||
} else {
|
||||
html = html.replace(CUSTOM_FILTERS, "");
|
||||
}
|
||||
iElement.append($compile(html)($scope));
|
||||
} else {
|
||||
iElement.append($compile($templateCache.get($scope.gridId + 'rowTemplate.html'))($scope));
|
||||
}
|
||||
$scope.$on('ngGridEventDigestRow', function(){
|
||||
domUtilityService.digest($scope);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
return ngRow;
|
||||
}]);
|
|
@ -1,31 +0,0 @@
|
|||
ngGridDirectives.directive('ngViewport', [function() {
|
||||
return function($scope, elm) {
|
||||
var isMouseWheelActive;
|
||||
var prevScollLeft;
|
||||
var prevScollTop = 0;
|
||||
elm.bind('scroll', function(evt) {
|
||||
var scrollLeft = evt.target.scrollLeft,
|
||||
scrollTop = evt.target.scrollTop;
|
||||
if ($scope.$headerContainer) {
|
||||
$scope.$headerContainer.scrollLeft(scrollLeft);
|
||||
}
|
||||
$scope.adjustScrollLeft(scrollLeft);
|
||||
$scope.adjustScrollTop(scrollTop);
|
||||
if (!$scope.$root.$$phase) {
|
||||
$scope.$digest();
|
||||
}
|
||||
prevScollLeft = scrollLeft;
|
||||
prevScollTop = prevScollTop;
|
||||
isMouseWheelActive = false;
|
||||
return true;
|
||||
});
|
||||
elm.bind("mousewheel DOMMouseScroll", function() {
|
||||
isMouseWheelActive = true;
|
||||
elm.focus();
|
||||
return true;
|
||||
});
|
||||
if (!$scope.enableCellSelection) {
|
||||
$scope.domAccessProvider.selectionHandlers($scope, elm);
|
||||
}
|
||||
};
|
||||
}]);
|
|
@ -1,5 +0,0 @@
|
|||
ngGridFilters.filter('checkmark', function() {
|
||||
return function(input) {
|
||||
return input ? '\u2714' : '\u2718';
|
||||
};
|
||||
});
|
|
@ -1,7 +0,0 @@
|
|||
ngGridFilters.filter('ngColumns', function() {
|
||||
return function(input) {
|
||||
return input.filter(function(col) {
|
||||
return !col.isAggCol;
|
||||
});
|
||||
};
|
||||
});
|
|
@ -1,14 +0,0 @@
|
|||
window.ngGrid.i18n['en'] = {
|
||||
ngAggregateLabel: 'items',
|
||||
ngGroupPanelDescription: 'Drag a column header here and drop it to group by that column.',
|
||||
ngSearchPlaceHolder: 'Search...',
|
||||
ngMenuText: 'Choose Columns:',
|
||||
ngShowingItemsLabel: 'Showing Items:',
|
||||
ngTotalItemsLabel: 'Total Items:',
|
||||
ngSelectedItemsLabel: 'Selected Items:',
|
||||
ngPageSizeLabel: 'Page Size:',
|
||||
ngPagerFirstTitle: 'First Page',
|
||||
ngPagerNextTitle: 'Next Page',
|
||||
ngPagerPrevTitle: 'Previous Page',
|
||||
ngPagerLastTitle: 'Last Page'
|
||||
};
|
|
@ -1,14 +0,0 @@
|
|||
window.ngGrid.i18n['fr'] = {
|
||||
ngAggregateLabel: 'articles',
|
||||
ngGroupPanelDescription: 'Faites glisser un en-tête de colonne ici et déposez-le vers un groupe par cette colonne.',
|
||||
ngSearchPlaceHolder: 'Recherche...',
|
||||
ngMenuText: 'Choisir des colonnes:',
|
||||
ngShowingItemsLabel: 'Articles Affichage des:',
|
||||
ngTotalItemsLabel: 'Nombre total d\'articles:',
|
||||
ngSelectedItemsLabel: 'Éléments Articles:',
|
||||
ngPageSizeLabel: 'Taille de page:',
|
||||
ngPagerFirstTitle: 'Première page',
|
||||
ngPagerNextTitle: 'Page Suivante',
|
||||
ngPagerPrevTitle: 'Page précédente',
|
||||
ngPagerLastTitle: 'Dernière page'
|
||||
};
|
|
@ -1,14 +0,0 @@
|
|||
window.ngGrid.i18n['ge'] = {
|
||||
ngAggregateLabel: 'artikel',
|
||||
ngGroupPanelDescription: 'Ziehen Sie eine Spaltenüberschrift hier und legen Sie es der Gruppe nach dieser Spalte.',
|
||||
ngSearchPlaceHolder: 'Suche...',
|
||||
ngMenuText: 'Spalten auswählen:',
|
||||
ngShowingItemsLabel: 'Zeige Artikel:',
|
||||
ngTotalItemsLabel: 'Meiste Artikel:',
|
||||
ngSelectedItemsLabel: 'Ausgewählte Artikel:',
|
||||
ngPageSizeLabel: 'Größe Seite:',
|
||||
ngPagerFirstTitle: 'Erste Page',
|
||||
ngPagerNextTitle: 'Nächste Page',
|
||||
ngPagerPrevTitle: 'Vorherige Page',
|
||||
ngPagerLastTitle: 'Letzte Page'
|
||||
};
|
|
@ -1,14 +0,0 @@
|
|||
window.ngGrid.i18n['sp'] = {
|
||||
ngAggregateLabel: 'Artículos',
|
||||
ngGroupPanelDescription: 'Arrastre un encabezado de columna aquí y soltarlo para agrupar por esa columna.',
|
||||
ngSearchPlaceHolder: 'Buscar...',
|
||||
ngMenuText: 'Elegir columnas:',
|
||||
ngShowingItemsLabel: 'Artículos Mostrando:',
|
||||
ngTotalItemsLabel: 'Artículos Totales:',
|
||||
ngSelectedItemsLabel: 'Artículos Seleccionados:',
|
||||
ngPageSizeLabel: 'Tamaño de Página:',
|
||||
ngPagerFirstTitle: 'Primera Página',
|
||||
ngPagerNextTitle: 'Página Siguiente',
|
||||
ngPagerPrevTitle: 'Página Anterior',
|
||||
ngPagerLastTitle: 'Última Página'
|
||||
};
|
|
@ -1,14 +0,0 @@
|
|||
window.ngGrid.i18n['zh-cn'] = {
|
||||
ngAggregateLabel: '条目',
|
||||
ngGroupPanelDescription: '拖曳表头到此处以进行分组',
|
||||
ngSearchPlaceHolder: '搜索...',
|
||||
ngMenuText: '数据分组与选择列:',
|
||||
ngShowingItemsLabel: '当前显示条目:',
|
||||
ngTotalItemsLabel: '条目总数:',
|
||||
ngSelectedItemsLabel: '选中条目:',
|
||||
ngPageSizeLabel: '每页显示数:',
|
||||
ngPagerFirstTitle: '回到首页',
|
||||
ngPagerNextTitle: '下一页',
|
||||
ngPagerPrevTitle: '上一页',
|
||||
ngPagerLastTitle: '前往尾页'
|
||||
};
|
|
@ -1,14 +0,0 @@
|
|||
window.ngGrid.i18n['zh-tw'] = {
|
||||
ngAggregateLabel: '筆',
|
||||
ngGroupPanelDescription: '拖拉表頭到此處以進行分組',
|
||||
ngSearchPlaceHolder: '搜尋...',
|
||||
ngMenuText: '選擇欄位:',
|
||||
ngShowingItemsLabel: '目前顯示筆數:',
|
||||
ngTotalItemsLabel: '總筆數:',
|
||||
ngSelectedItemsLabel: '選取筆數:',
|
||||
ngPageSizeLabel: '每頁顯示:',
|
||||
ngPagerFirstTitle: '第一頁',
|
||||
ngPagerNextTitle: '下一頁',
|
||||
ngPagerPrevTitle: '上一頁',
|
||||
ngPagerLastTitle: '最後頁'
|
||||
};
|
|
@ -1,9 +0,0 @@
|
|||
window.ngGrid = {};
|
||||
window.ngGrid.i18n = {};
|
||||
|
||||
// Declare app level module which depends on filters, and services
|
||||
var ngGridServices = angular.module('ngGrid.services', []);
|
||||
var ngGridDirectives = angular.module('ngGrid.directives', []);
|
||||
var ngGridFilters = angular.module('ngGrid.filters', []);
|
||||
// initialization of services into the main module
|
||||
angular.module('ngGrid', ['ngGrid.services', 'ngGrid.directives', 'ngGrid.filters']);
|
|
@ -1,104 +0,0 @@
|
|||
//set event binding on the grid so we can select using the up/down keys
|
||||
var ngMoveSelectionHandler = function($scope, elm, evt, grid) {
|
||||
if ($scope.selectionProvider.selectedItems === undefined) {
|
||||
return true;
|
||||
}
|
||||
var charCode = evt.which || evt.keyCode,
|
||||
newColumnIndex,
|
||||
lastInRow = false,
|
||||
firstInRow = false,
|
||||
rowIndex = $scope.selectionProvider.lastClickedRow.rowIndex,
|
||||
visibleCols = $scope.columns.filter(function(c) { return c.visible; }),
|
||||
pinnedCols = $scope.columns.filter(function(c) { return c.pinned; });
|
||||
|
||||
if ($scope.col) {
|
||||
newColumnIndex = visibleCols.indexOf($scope.col);
|
||||
}
|
||||
if(charCode != 37 && charCode != 38 && charCode != 39 && charCode != 40 && charCode != 9 && charCode != 13){
|
||||
return true;
|
||||
}
|
||||
|
||||
if($scope.enableCellSelection){
|
||||
if(charCode == 9){ //tab key
|
||||
evt.preventDefault();
|
||||
}
|
||||
var focusedOnFirstColumn = $scope.showSelectionCheckbox ? $scope.col.index == 1 : $scope.col.index == 0;
|
||||
var focusedOnFirstVisibleColumns = $scope.$index == 1 || $scope.$index == 0;
|
||||
var focusedOnLastVisibleColumns = $scope.$index == ($scope.renderedColumns.length - 1) || $scope.$index == ($scope.renderedColumns.length - 2);
|
||||
var focusedOnLastColumn = visibleCols.indexOf($scope.col) == (visibleCols.length - 1);
|
||||
var focusedOnLastPinnedColumn = pinnedCols.indexOf($scope.col) == (pinnedCols.length - 1);
|
||||
|
||||
if (charCode == 37 || charCode == 9 && evt.shiftKey) {
|
||||
var scrollTo = 0;
|
||||
if (!focusedOnFirstColumn) {
|
||||
newColumnIndex -= 1;
|
||||
}
|
||||
if (focusedOnFirstVisibleColumns) {
|
||||
if(focusedOnFirstColumn && charCode == 9 && evt.shiftKey){
|
||||
scrollTo = grid.$canvas.width();
|
||||
newColumnIndex = visibleCols.length - 1;
|
||||
firstInRow = true;
|
||||
} else {
|
||||
scrollTo = grid.$viewport.scrollLeft() - $scope.col.width;
|
||||
}
|
||||
} else if (pinnedCols.length > 0) {
|
||||
scrollTo = grid.$viewport.scrollLeft() - visibleCols[newColumnIndex].width;
|
||||
}
|
||||
grid.$viewport.scrollLeft(scrollTo);
|
||||
|
||||
} else if(charCode == 39 || charCode == 9 && !evt.shiftKey){
|
||||
if (focusedOnLastVisibleColumns) {
|
||||
if(focusedOnLastColumn && charCode == 9 && !evt.shiftKey){
|
||||
grid.$viewport.scrollLeft(0);
|
||||
newColumnIndex = $scope.showSelectionCheckbox ? 1 : 0;
|
||||
lastInRow = true;
|
||||
} else {
|
||||
|
||||
grid.$viewport.scrollLeft(grid.$viewport.scrollLeft() + $scope.col.width);
|
||||
}
|
||||
} else if (focusedOnLastPinnedColumn) {
|
||||
grid.$viewport.scrollLeft(0);
|
||||
}
|
||||
if(!focusedOnLastColumn){
|
||||
newColumnIndex += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var items;
|
||||
if ($scope.configGroups.length > 0) {
|
||||
items = grid.rowFactory.parsedData.filter(function (row) {
|
||||
return !row.isAggRow;
|
||||
});
|
||||
} else {
|
||||
items = grid.filteredRows;
|
||||
}
|
||||
|
||||
var offset = 0;
|
||||
if(rowIndex != 0 && (charCode == 38 || charCode == 13 && evt.shiftKey || charCode == 9 && evt.shiftKey && firstInRow)){ //arrow key up or shift enter or tab key and first item in row
|
||||
offset = -1;
|
||||
} else if(rowIndex != items.length - 1 && (charCode == 40 || charCode == 13 && !evt.shiftKey || charCode == 9 && lastInRow)){//arrow key down, enter, or tab key and last item in row?
|
||||
offset = 1;
|
||||
}
|
||||
|
||||
if (offset) {
|
||||
var r = items[rowIndex + offset];
|
||||
if (r.beforeSelectionChange(r, evt)) {
|
||||
r.continueSelection(evt);
|
||||
$scope.$emit('ngGridEventDigestGridParent');
|
||||
|
||||
if ($scope.selectionProvider.lastClickedRow.renderedRowIndex >= $scope.renderedRows.length - EXCESS_ROWS - 2) {
|
||||
grid.$viewport.scrollTop(grid.$viewport.scrollTop() + $scope.rowHeight);
|
||||
} else if ($scope.selectionProvider.lastClickedRow.renderedRowIndex <= EXCESS_ROWS + 2) {
|
||||
grid.$viewport.scrollTop(grid.$viewport.scrollTop() - $scope.rowHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($scope.enableCellSelection){
|
||||
setTimeout(function(){
|
||||
$scope.domAccessProvider.focusCellElement($scope, $scope.renderedColumns.indexOf(visibleCols[newColumnIndex]));
|
||||
},3);
|
||||
}
|
||||
return false;
|
||||
};
|
|
@ -1,145 +0,0 @@
|
|||
ngGridServices.factory('$domUtilityService',['$utilityService', function($utils) {
|
||||
var domUtilityService = {};
|
||||
var regexCache = {};
|
||||
var getWidths = function() {
|
||||
var $testContainer = $('<div></div>');
|
||||
$testContainer.appendTo('body');
|
||||
// 1. Run all the following measurements on startup!
|
||||
//measure Scroll Bars
|
||||
$testContainer.height(100).width(100).css("position", "absolute").css("overflow", "scroll");
|
||||
$testContainer.append('<div style="height: 400px; width: 400px;"></div>');
|
||||
domUtilityService.ScrollH = ($testContainer.height() - $testContainer[0].clientHeight);
|
||||
domUtilityService.ScrollW = ($testContainer.width() - $testContainer[0].clientWidth);
|
||||
$testContainer.empty();
|
||||
//clear styles
|
||||
$testContainer.attr('style', '');
|
||||
//measure letter sizes using a pretty typical font size and fat font-family
|
||||
$testContainer.append('<span style="font-family: Verdana, Helvetica, Sans-Serif; font-size: 14px;"><strong>M</strong></span>');
|
||||
domUtilityService.LetterW = $testContainer.children().first().width();
|
||||
$testContainer.remove();
|
||||
};
|
||||
domUtilityService.eventStorage = {};
|
||||
domUtilityService.AssignGridContainers = function($scope, rootEl, grid) {
|
||||
grid.$root = $(rootEl);
|
||||
//Headers
|
||||
grid.$topPanel = grid.$root.find(".ngTopPanel");
|
||||
grid.$groupPanel = grid.$root.find(".ngGroupPanel");
|
||||
grid.$headerContainer = grid.$topPanel.find(".ngHeaderContainer");
|
||||
$scope.$headerContainer = grid.$headerContainer;
|
||||
|
||||
grid.$headerScroller = grid.$topPanel.find(".ngHeaderScroller");
|
||||
grid.$headers = grid.$headerScroller.children();
|
||||
//Viewport
|
||||
grid.$viewport = grid.$root.find(".ngViewport");
|
||||
//Canvas
|
||||
grid.$canvas = grid.$viewport.find(".ngCanvas");
|
||||
//Footers
|
||||
grid.$footerPanel = grid.$root.find(".ngFooterPanel");
|
||||
|
||||
$scope.$watch(function () {
|
||||
return grid.$viewport.scrollLeft();
|
||||
}, function (newLeft) {
|
||||
return grid.$headerContainer.scrollLeft(newLeft);
|
||||
});
|
||||
domUtilityService.UpdateGridLayout($scope, grid);
|
||||
};
|
||||
domUtilityService.getRealWidth = function (obj) {
|
||||
var width = 0;
|
||||
var props = { visibility: "hidden", display: "block" };
|
||||
var hiddenParents = obj.parents().andSelf().not(':visible');
|
||||
$.swap(hiddenParents[0], props, function () {
|
||||
width = obj.outerWidth();
|
||||
});
|
||||
return width;
|
||||
};
|
||||
domUtilityService.UpdateGridLayout = function($scope, grid) {
|
||||
//catch this so we can return the viewer to their original scroll after the resize!
|
||||
var scrollTop = grid.$viewport.scrollTop();
|
||||
grid.elementDims.rootMaxW = grid.$root.width();
|
||||
if (grid.$root.is(':hidden')) {
|
||||
grid.elementDims.rootMaxW = domUtilityService.getRealWidth(grid.$root);
|
||||
}
|
||||
grid.elementDims.rootMaxH = grid.$root.height();
|
||||
//check to see if anything has changed
|
||||
grid.refreshDomSizes();
|
||||
$scope.adjustScrollTop(scrollTop, true); //ensure that the user stays scrolled where they were
|
||||
};
|
||||
domUtilityService.numberOfGrids = 0;
|
||||
domUtilityService.BuildStyles = function($scope, grid, digest) {
|
||||
var rowHeight = grid.config.rowHeight,
|
||||
$style = grid.$styleSheet,
|
||||
gridId = grid.gridId,
|
||||
css,
|
||||
cols = $scope.columns,
|
||||
sumWidth = 0;
|
||||
|
||||
if (!$style) {
|
||||
$style = $('#' + gridId);
|
||||
if (!$style[0]) {
|
||||
$style = $("<style id='" + gridId + "' type='text/css' rel='stylesheet' />").appendTo(grid.$root);
|
||||
}
|
||||
}
|
||||
$style.empty();
|
||||
var trw = $scope.totalRowWidth();
|
||||
css = "." + gridId + " .ngCanvas { width: " + trw + "px; }" +
|
||||
"." + gridId + " .ngRow { width: " + trw + "px; }" +
|
||||
"." + gridId + " .ngCanvas { width: " + trw + "px; }" +
|
||||
"." + gridId + " .ngHeaderScroller { width: " + (trw + domUtilityService.ScrollH + 2) + "px}";
|
||||
for (var i = 0; i < cols.length; i++) {
|
||||
var col = cols[i];
|
||||
if (col.visible !== false) {
|
||||
var colLeft = col.pinned ? grid.$viewport.scrollLeft() + sumWidth : sumWidth;
|
||||
css += "." + gridId + " .col" + i + " { width: " + col.width + "px; left: " + colLeft + "px; height: " + rowHeight + "px }" +
|
||||
"." + gridId + " .colt" + i + " { width: " + col.width + "px; }";
|
||||
sumWidth += col.width;
|
||||
}
|
||||
};
|
||||
if ($utils.isIe) { // IE
|
||||
$style[0].styleSheet.cssText = css;
|
||||
} else {
|
||||
$style[0].appendChild(document.createTextNode(css));
|
||||
}
|
||||
grid.$styleSheet = $style;
|
||||
if (digest) {
|
||||
$scope.adjustScrollLeft(grid.$viewport.scrollLeft());
|
||||
domUtilityService.digest($scope);
|
||||
}
|
||||
};
|
||||
domUtilityService.setColLeft = function(col, colLeft, grid) {
|
||||
if (grid.$styleSheet) {
|
||||
var regex = regexCache[col.index];
|
||||
if (!regex) {
|
||||
regex = regexCache[col.index] = new RegExp("\.col" + col.index + " \{ width: [0-9]+px; left: [0-9]+px");
|
||||
}
|
||||
var str = grid.$styleSheet.html();
|
||||
var newStr = str.replace(regex, "\.col" + col.index + " \{ width: " + col.width + "px; left: " + colLeft + "px");
|
||||
if ($utils.isIe) { // IE
|
||||
setTimeout(function() {
|
||||
grid.$styleSheet.html(newStr);
|
||||
});
|
||||
} else {
|
||||
grid.$styleSheet.html(newStr);
|
||||
}
|
||||
}
|
||||
};
|
||||
domUtilityService.setColLeft.immediate = 1;
|
||||
domUtilityService.RebuildGrid = function($scope, grid){
|
||||
domUtilityService.UpdateGridLayout($scope, grid);
|
||||
if (grid.config.maintainColumnRatios) {
|
||||
grid.configureColumnWidths();
|
||||
}
|
||||
$scope.adjustScrollLeft(grid.$viewport.scrollLeft());
|
||||
domUtilityService.BuildStyles($scope, grid, true);
|
||||
};
|
||||
|
||||
domUtilityService.digest = function($scope) {
|
||||
if (!$scope.$root.$$phase) {
|
||||
$scope.$digest();
|
||||
}
|
||||
};
|
||||
domUtilityService.ScrollH = 17; // default in IE, Chrome, & most browsers
|
||||
domUtilityService.ScrollW = 17; // default in IE, Chrome, & most browsers
|
||||
domUtilityService.LetterW = 10;
|
||||
getWidths();
|
||||
return domUtilityService;
|
||||
}]);
|
|
@ -1,167 +0,0 @@
|
|||
ngGridServices.factory('$sortService', ['$parse', function($parse) {
|
||||
var sortService = {};
|
||||
sortService.colSortFnCache = {}; // cache of sorting functions. Once we create them, we don't want to keep re-doing it
|
||||
// this takes an piece of data from the cell and tries to determine its type and what sorting
|
||||
// function to use for it
|
||||
// @item - the cell data
|
||||
sortService.guessSortFn = function(item) {
|
||||
var itemType = typeof(item);
|
||||
//check for numbers and booleans
|
||||
switch (itemType) {
|
||||
case "number":
|
||||
return sortService.sortNumber;
|
||||
case "boolean":
|
||||
return sortService.sortBool;
|
||||
case "string":
|
||||
// if number string return number string sort fn. else return the str
|
||||
return item.match(/^-?[£$¤]?[\d,.]+%?$/) ? sortService.sortNumberStr : sortService.sortAlpha;
|
||||
default:
|
||||
//check if the item is a valid Date
|
||||
if (Object.prototype.toString.call(item) === '[object Date]') {
|
||||
return sortService.sortDate;
|
||||
} else {
|
||||
//finally just sort the basic sort...
|
||||
return sortService.basicSort;
|
||||
}
|
||||
}
|
||||
};
|
||||
//#region Sorting Functions
|
||||
sortService.basicSort = function(a, b) {
|
||||
if (a == b) {
|
||||
return 0;
|
||||
}
|
||||
if (a < b) {
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
};
|
||||
sortService.sortNumber = function(a, b) {
|
||||
return a - b;
|
||||
};
|
||||
sortService.sortNumberStr = function(a, b) {
|
||||
var numA, numB, badA = false, badB = false;
|
||||
numA = parseFloat(a.replace(/[^0-9.-]/g, ''));
|
||||
if (isNaN(numA)) {
|
||||
badA = true;
|
||||
}
|
||||
numB = parseFloat(b.replace(/[^0-9.-]/g, ''));
|
||||
if (isNaN(numB)) {
|
||||
badB = true;
|
||||
}
|
||||
// we want bad ones to get pushed to the bottom... which effectively is "greater than"
|
||||
if (badA && badB) {
|
||||
return 0;
|
||||
}
|
||||
if (badA) {
|
||||
return 1;
|
||||
}
|
||||
if (badB) {
|
||||
return -1;
|
||||
}
|
||||
return numA - numB;
|
||||
};
|
||||
sortService.sortAlpha = function(a, b) {
|
||||
var strA = a.toLowerCase(),
|
||||
strB = b.toLowerCase();
|
||||
return strA == strB ? 0 : (strA < strB ? -1 : 1);
|
||||
};
|
||||
sortService.sortDate = function(a, b) {
|
||||
var timeA = a.getTime(),
|
||||
timeB = b.getTime();
|
||||
return timeA == timeB ? 0 : (timeA < timeB ? -1 : 1);
|
||||
};
|
||||
sortService.sortBool = function(a, b) {
|
||||
if (a && b) {
|
||||
return 0;
|
||||
}
|
||||
if (!a && !b) {
|
||||
return 0;
|
||||
} else {
|
||||
return a ? 1 : -1;
|
||||
}
|
||||
};
|
||||
//#endregion
|
||||
// the core sorting logic trigger
|
||||
sortService.sortData = function(sortInfo, data /*datasource*/) {
|
||||
// first make sure we are even supposed to do work
|
||||
if (!data || !sortInfo) {
|
||||
return;
|
||||
}
|
||||
var l = sortInfo.fields.length,
|
||||
order = sortInfo.fields,
|
||||
col,
|
||||
direction,
|
||||
// IE9 HACK.... omg, I can't reference data array within the sort fn below. has to be a separate reference....!!!!
|
||||
d = data.slice(0);
|
||||
//now actually sort the data
|
||||
data.sort(function (itemA, itemB) {
|
||||
var tem = 0,
|
||||
indx = 0,
|
||||
sortFn;
|
||||
while (tem == 0 && indx < l) {
|
||||
// grab the metadata for the rest of the logic
|
||||
col = sortInfo.columns[indx];
|
||||
direction = sortInfo.directions[indx],
|
||||
sortFn = sortService.getSortFn(col, d);
|
||||
|
||||
var propA = $parse(order[indx])(itemA);
|
||||
var propB = $parse(order[indx])(itemB);
|
||||
// we want to allow zero values to be evaluated in the sort function
|
||||
if ((!propA && propA != 0) || (!propB && propB != 0)) {
|
||||
// we want to force nulls and such to the bottom when we sort... which effectively is "greater than"
|
||||
if (!propB && !propA) {
|
||||
tem = 0;
|
||||
} else if (!propA) {
|
||||
tem = 1;
|
||||
} else if (!propB) {
|
||||
tem = -1;
|
||||
}
|
||||
} else {
|
||||
tem = sortFn(propA, propB);
|
||||
}
|
||||
indx++;
|
||||
}
|
||||
//made it this far, we don't have to worry about null & undefined
|
||||
if (direction === ASC) {
|
||||
return tem;
|
||||
} else {
|
||||
return 0 - tem;
|
||||
}
|
||||
});
|
||||
};
|
||||
sortService.Sort = function(sortInfo, data) {
|
||||
if (sortService.isSorting) {
|
||||
return;
|
||||
}
|
||||
sortService.isSorting = true;
|
||||
sortService.sortData(sortInfo, data);
|
||||
sortService.isSorting = false;
|
||||
};
|
||||
sortService.getSortFn = function(col, data) {
|
||||
var sortFn = undefined, item;
|
||||
//see if we already figured out what to use to sort the column
|
||||
if (sortService.colSortFnCache[col.field]) {
|
||||
sortFn = sortService.colSortFnCache[col.field];
|
||||
} else if (col.sortingAlgorithm != undefined) {
|
||||
sortFn = col.sortingAlgorithm;
|
||||
sortService.colSortFnCache[col.field] = col.sortingAlgorithm;
|
||||
} else { // try and guess what sort function to use
|
||||
item = data[0];
|
||||
if (!item) {
|
||||
return sortFn;
|
||||
}
|
||||
sortFn = sortService.guessSortFn($parse(col.field)(item));
|
||||
//cache it
|
||||
if (sortFn) {
|
||||
sortService.colSortFnCache[col.field] = sortFn;
|
||||
} else {
|
||||
// we assign the alpha sort because anything that is null/undefined will never get passed to
|
||||
// the actual sorting function. It will get caught in our null check and returned to be sorted
|
||||
// down to the bottom
|
||||
sortFn = sortService.sortAlpha;
|
||||
}
|
||||
}
|
||||
return sortFn;
|
||||
};
|
||||
return sortService;
|
||||
}]);
|
|
@ -1,83 +0,0 @@
|
|||
ngGridServices.factory('$utilityService', ['$parse', function ($parse) {
|
||||
var funcNameRegex = /function (.{1,})\(/;
|
||||
var utils = {
|
||||
visualLength: function(node) {
|
||||
var elem = document.getElementById('testDataLength');
|
||||
if (!elem) {
|
||||
elem = document.createElement('SPAN');
|
||||
elem.id = "testDataLength";
|
||||
elem.style.visibility = "hidden";
|
||||
document.body.appendChild(elem);
|
||||
}
|
||||
$(elem).css('font', $(node).css('font'));
|
||||
elem.innerHTML = $(node).text();
|
||||
return elem.offsetWidth;
|
||||
},
|
||||
forIn: function(obj, action) {
|
||||
for (var prop in obj) {
|
||||
if (obj.hasOwnProperty(prop)) {
|
||||
action(obj[prop], prop);
|
||||
}
|
||||
}
|
||||
},
|
||||
evalProperty: function (entity, path) {
|
||||
return $parse(path)(entity);
|
||||
},
|
||||
endsWith: function(str, suffix) {
|
||||
if (!str || !suffix || typeof str != "string") {
|
||||
return false;
|
||||
}
|
||||
return str.indexOf(suffix, str.length - suffix.length) !== -1;
|
||||
},
|
||||
isNullOrUndefined: function(obj) {
|
||||
if (obj === undefined || obj === null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
getElementsByClassName: function(cl) {
|
||||
var retnode = [];
|
||||
var myclass = new RegExp('\\b' + cl + '\\b');
|
||||
var elem = document.getElementsByTagName('*');
|
||||
for (var i = 0; i < elem.length; i++) {
|
||||
var classes = elem[i].className;
|
||||
if (myclass.test(classes)) {
|
||||
retnode.push(elem[i]);
|
||||
}
|
||||
}
|
||||
return retnode;
|
||||
},
|
||||
newId: (function() {
|
||||
var seedId = new Date().getTime();
|
||||
return function() {
|
||||
return seedId += 1;
|
||||
};
|
||||
})(),
|
||||
seti18n: function($scope, language) {
|
||||
var $langPack = window.ngGrid.i18n[language];
|
||||
for (var label in $langPack) {
|
||||
$scope.i18n[label] = $langPack[label];
|
||||
}
|
||||
},
|
||||
getInstanceType: function (o) {
|
||||
var results = (funcNameRegex).exec(o.constructor.toString());
|
||||
return (results && results.length > 1) ? results[1] : "";
|
||||
},
|
||||
// we copy KO's ie detection here bc it isn't exported in the min versions of KO
|
||||
// Detect IE versions for workarounds (uses IE conditionals, not UA string, for robustness)
|
||||
ieVersion: (function() {
|
||||
var version = 3, div = document.createElement('div'), iElems = div.getElementsByTagName('i');
|
||||
// Keep constructing conditional HTML blocks until we hit one that resolves to an empty fragment
|
||||
while (div.innerHTML = '<!--[if gt IE ' + (++version) + ']><i></i><![endif]-->',
|
||||
iElems[0]) ;
|
||||
return version > 4 ? version : undefined;
|
||||
})()
|
||||
};
|
||||
|
||||
$.extend(utils, {
|
||||
isIe: (function() {
|
||||
return utils.ieVersion !== undefined;
|
||||
})()
|
||||
});
|
||||
return utils;
|
||||
}]);
|
|
@ -1,4 +0,0 @@
|
|||
<div ng-click="row.toggleExpand()" ng-style="rowStyle(row)" ng-style="{'left': row.offsetleft}" class="ngAggregate">
|
||||
<span class="ngAggregateText">{{row.label CUSTOM_FILTERS}} ({{row.totalChildren()}} {{AggItemsLabel}})</span>
|
||||
<div class="{{row.aggClass()}}"></div>
|
||||
</div>
|
|
@ -1,8 +0,0 @@
|
|||
<div ng-cell-has-focus ng-dblclick="editCell()">
|
||||
<div ng-if="!isFocused">
|
||||
DISPLAY_CELL_TEMPLATE
|
||||
</div>
|
||||
<div ng-if="isFocused">
|
||||
EDITABLE_CELL_TEMPLATE
|
||||
</div>
|
||||
</div>
|
|
@ -1 +0,0 @@
|
|||
<div class="ngCellText" ng-class="col.colIndex()"><span ng-cell-text>{{COL_FIELD CUSTOM_FILTERS}}</span></div>
|
|
@ -1 +0,0 @@
|
|||
<div class="ngSelectionCell"><input tabindex="-1" class="ngSelectionCheckbox" type="checkbox" ng-checked="row.selected" /></div>
|
|
@ -1 +0,0 @@
|
|||
<input class="ngSelectionHeader" type="checkbox" ng-show="multiSelect" ng-model="allSelected" ng-change="toggleSelectAll(allSelected)"/>
|
|
@ -1 +0,0 @@
|
|||
<input ng-class="'colt' + col.index" ng-input="COL_FIELD" />
|
|
@ -1,25 +0,0 @@
|
|||
<div ng-show="showFooter" class="ngFooterPanel" ng-class="{'ui-widget-content': jqueryUITheme, 'ui-corner-bottom': jqueryUITheme}" ng-style="footerStyle()">
|
||||
<div class="ngTotalSelectContainer" >
|
||||
<div class="ngFooterTotalItems" ng-class="{'ngNoMultiSelect': !multiSelect}" >
|
||||
<span class="ngLabel">{{i18n.ngTotalItemsLabel}} {{maxRows()}}</span><span ng-show="filterText.length > 0" class="ngLabel">({{i18n.ngShowingItemsLabel}} {{totalFilteredItemsLength()}})</span>
|
||||
</div>
|
||||
<div class="ngFooterSelectedItems" ng-show="multiSelect">
|
||||
<span class="ngLabel">{{i18n.ngSelectedItemsLabel}} {{selectedItems.length}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ngPagerContainer" style="float: right; margin-top: 10px;" ng-show="enablePaging" ng-class="{'ngNoMultiSelect': !multiSelect}">
|
||||
<div style="float:left; margin-right: 10px;" class="ngRowCountPicker">
|
||||
<span style="float: left; margin-top: 3px;" class="ngLabel">{{i18n.ngPageSizeLabel}}</span>
|
||||
<select style="float: left;height: 27px; width: 100px" ng-model="pagingOptions.pageSize" >
|
||||
<option ng-repeat="size in pagingOptions.pageSizes">{{size}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div style="float:left; margin-right: 10px; line-height:25px;" class="ngPagerControl" style="float: left; min-width: 135px;">
|
||||
<button class="ngPagerButton" ng-click="pageToFirst()" ng-disabled="cantPageBackward()" title="{{i18n.ngPagerFirstTitle}}"><div class="ngPagerFirstTriangle"><div class="ngPagerFirstBar"></div></div></button>
|
||||
<button class="ngPagerButton" ng-click="pageBackward()" ng-disabled="cantPageBackward()" title="{{i18n.ngPagerPrevTitle}}"><div class="ngPagerFirstTriangle ngPagerPrevTriangle"></div></button>
|
||||
<input class="ngPagerCurrent" type="number" style="width:50px; height: 24px; margin-top: 1px; padding: 0 4px;" ng-model="pagingOptions.currentPage"/>
|
||||
<button class="ngPagerButton" ng-click="pageForward()" ng-disabled="cantPageForward()" title="{{i18n.ngPagerNextTitle}}"><div class="ngPagerLastTriangle ngPagerNextTriangle"></div></button>
|
||||
<button class="ngPagerButton" ng-click="pageToLast()" ng-disabled="cantPageToLast()" title="{{i18n.ngPagerLastTitle}}"><div class="ngPagerLastTriangle"><div class="ngPagerLastBar"></div></div></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,25 +0,0 @@
|
|||
<div class="ngTopPanel" ng-class="{'ui-widget-header':jqueryUITheme, 'ui-corner-top': jqueryUITheme}" ng-style="topPanelStyle()">
|
||||
<div class="ngGroupPanel" ng-show="showGroupPanel()" ng-style="groupPanelStyle()">
|
||||
<div class="ngGroupPanelDescription" ng-show="configGroups.length == 0">{{i18n.ngGroupPanelDescription}}</div>
|
||||
<ul ng-show="configGroups.length > 0" class="ngGroupList">
|
||||
<li class="ngGroupItem" ng-repeat="group in configGroups">
|
||||
<span class="ngGroupElement">
|
||||
<span class="ngGroupName">{{group.displayName}}
|
||||
<span ng-click="removeGroup($index)" class="ngRemoveGroup">x</span>
|
||||
</span>
|
||||
<span ng-hide="$last" class="ngGroupArrow"></span>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ngHeaderContainer" ng-style="headerStyle()">
|
||||
<div class="ngHeaderScroller" ng-style="headerScrollerStyle()" ng-include="gridId + 'headerRowTemplate.html'"></div>
|
||||
</div>
|
||||
<div ng-grid-menu></div>
|
||||
</div>
|
||||
<div class="ngViewport" unselectable="on" ng-viewport ng-class="{'ui-widget-content': jqueryUITheme}" ng-style="viewportStyle()">
|
||||
<div class="ngCanvas" ng-style="canvasStyle()">
|
||||
<div ng-style="rowStyle(row)" ng-repeat="row in renderedRows" ng-click="row.toggleSelected($event)" ng-class="row.alternatingRowClass()" ng-row></div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-grid-footer></div>
|
|
@ -1,8 +0,0 @@
|
|||
<div class="ngHeaderSortColumn {{col.headerClass}}" ng-style="{'cursor': col.cursor}" ng-class="{ 'ngSorted': !noSortVisible }">
|
||||
<div ng-click="col.sort($event)" ng-class="'colt' + col.index" class="ngHeaderText">{{col.displayName}}</div>
|
||||
<div class="ngSortButtonDown" ng-show="col.showSortButtonDown()"></div>
|
||||
<div class="ngSortButtonUp" ng-show="col.showSortButtonUp()"></div>
|
||||
<div class="ngSortPriority">{{col.sortPriority}}</div>
|
||||
<div ng-class="{ ngPinnedIcon: col.pinned, ngUnPinnedIcon: !col.pinned }" ng-click="togglePin(col)" ng-show="col.pinnable"></div>
|
||||
</div>
|
||||
<div ng-show="col.resizable" class="ngHeaderGrip" ng-click="col.gripClick($event)" ng-mousedown="col.gripOnMouseDown($event)"></div>
|
|
@ -1 +0,0 @@
|
|||
<div ng-style="{ height: col.headerRowHeight }" ng-repeat="col in renderedColumns" ng-class="col.colIndex()" class="ngHeaderCell" ng-header-cell></div>
|
|
@ -1,18 +0,0 @@
|
|||
<div ng-show="showColumnMenu || showFilter" class="ngHeaderButton" ng-click="toggleShowMenu()">
|
||||
<div class="ngHeaderButtonArrow"></div>
|
||||
</div>
|
||||
<div ng-show="showMenu" class="ngColMenu">
|
||||
<div ng-show="showFilter">
|
||||
<input placeholder="{{i18n.ngSearchPlaceHolder}}" type="text" ng-model="filterText"/>
|
||||
</div>
|
||||
<div ng-show="showColumnMenu">
|
||||
<span class="ngMenuText">{{i18n.ngMenuText}}</span>
|
||||
<ul class="ngColList">
|
||||
<li class="ngColListItem" ng-repeat="col in columns | ngColumns">
|
||||
<label><input ng-disabled="col.pinned" type="checkbox" class="ngColListCheckbox" ng-model="col.visible"/>{{col.displayName}}</label>
|
||||
<a title="Group By" ng-class="col.groupedByClass()" ng-show="col.groupable && col.visible" ng-click="groupBy(col)"></a>
|
||||
<span class="ngGroupingNumber" ng-show="col.groupIndex > 0">{{col.groupIndex}}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
|
@ -1 +0,0 @@
|
|||
<div ng-style="{ 'cursor': row.cursor }" ng-repeat="col in renderedColumns" ng-class="col.colIndex()" class="ngCell {{col.cellClass}}" ng-cell></div>
|
|
@ -1,42 +0,0 @@
|
|||
if (!String.prototype.trim) {
|
||||
String.prototype.trim = function() {
|
||||
return this.replace(/^\s+|\s+$/g, '');
|
||||
};
|
||||
}
|
||||
if (!Array.prototype.indexOf) {
|
||||
Array.prototype.indexOf = function(elt /*, from*/) {
|
||||
var len = this.length >>> 0;
|
||||
var from = Number(arguments[1]) || 0;
|
||||
from = (from < 0) ? Math.ceil(from) : Math.floor(from);
|
||||
if (from < 0) {
|
||||
from += len;
|
||||
}
|
||||
for (; from < len; from++) {
|
||||
if (from in this && this[from] === elt) {
|
||||
return from;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
if (!Array.prototype.filter) {
|
||||
Array.prototype.filter = function(fun /*, thisp */) {
|
||||
"use strict";
|
||||
var t = Object(this);
|
||||
var len = t.length >>> 0;
|
||||
if (typeof fun !== "function") {
|
||||
throw new TypeError();
|
||||
}
|
||||
var res = [];
|
||||
var thisp = arguments[1];
|
||||
for (var i = 0; i < len; i++) {
|
||||
if (i in t) {
|
||||
var val = t[i]; // in case fun mutates this
|
||||
if (fun.call(thisp, val, i, t)) {
|
||||
res.push(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
};
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>End2end Test Runner</title>
|
||||
<script src="../lib/angular/angular-scenario.js" ng-autotest></script>
|
||||
<script src="scenarios.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -1,9 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
|
||||
|
||||
describe('my app', function() {
|
||||
beforeEach(function() {
|
||||
browser().navigateTo('../../workbench/index.html');
|
||||
});
|
||||
});
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1 +0,0 @@
|
|||
1.0.5
|
|
@ -1,616 +0,0 @@
|
|||
jasmine.HtmlReporterHelpers = {};
|
||||
|
||||
jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
|
||||
var el = document.createElement(type);
|
||||
|
||||
for (var i = 2; i < arguments.length; i++) {
|
||||
var child = arguments[i];
|
||||
|
||||
if (typeof child === 'string') {
|
||||
el.appendChild(document.createTextNode(child));
|
||||
} else {
|
||||
if (child) {
|
||||
el.appendChild(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var attr in attrs) {
|
||||
if (attr == "className") {
|
||||
el[attr] = attrs[attr];
|
||||
} else {
|
||||
el.setAttribute(attr, attrs[attr]);
|
||||
}
|
||||
}
|
||||
|
||||
return el;
|
||||
};
|
||||
|
||||
jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
|
||||
var results = child.results();
|
||||
var status = results.passed() ? 'passed' : 'failed';
|
||||
if (results.skipped) {
|
||||
status = 'skipped';
|
||||
}
|
||||
|
||||
return status;
|
||||
};
|
||||
|
||||
jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
|
||||
var parentDiv = this.dom.summary;
|
||||
var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
|
||||
var parent = child[parentSuite];
|
||||
|
||||
if (parent) {
|
||||
if (typeof this.views.suites[parent.id] == 'undefined') {
|
||||
this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
|
||||
}
|
||||
parentDiv = this.views.suites[parent.id].element;
|
||||
}
|
||||
|
||||
parentDiv.appendChild(childElement);
|
||||
};
|
||||
|
||||
|
||||
jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
|
||||
for(var fn in jasmine.HtmlReporterHelpers) {
|
||||
ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
|
||||
}
|
||||
};
|
||||
|
||||
jasmine.HtmlReporter = function(_doc) {
|
||||
var self = this;
|
||||
var doc = _doc || window.document;
|
||||
|
||||
var reporterView;
|
||||
|
||||
var dom = {};
|
||||
|
||||
// Jasmine Reporter Public Interface
|
||||
self.logRunningSpecs = false;
|
||||
|
||||
self.reportRunnerStarting = function(runner) {
|
||||
var specs = runner.specs() || [];
|
||||
|
||||
if (specs.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
createReporterDom(runner.env.versionString());
|
||||
doc.body.appendChild(dom.reporter);
|
||||
|
||||
reporterView = new jasmine.HtmlReporter.ReporterView(dom);
|
||||
reporterView.addSpecs(specs, self.specFilter);
|
||||
};
|
||||
|
||||
self.reportRunnerResults = function(runner) {
|
||||
reporterView && reporterView.complete();
|
||||
};
|
||||
|
||||
self.reportSuiteResults = function(suite) {
|
||||
reporterView.suiteComplete(suite);
|
||||
};
|
||||
|
||||
self.reportSpecStarting = function(spec) {
|
||||
if (self.logRunningSpecs) {
|
||||
self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
|
||||
}
|
||||
};
|
||||
|
||||
self.reportSpecResults = function(spec) {
|
||||
reporterView.specComplete(spec);
|
||||
};
|
||||
|
||||
self.log = function() {
|
||||
var console = jasmine.getGlobal().console;
|
||||
if (console && console.log) {
|
||||
if (console.log.apply) {
|
||||
console.log.apply(console, arguments);
|
||||
} else {
|
||||
console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
self.specFilter = function(spec) {
|
||||
if (!focusedSpecName()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return spec.getFullName().indexOf(focusedSpecName()) === 0;
|
||||
};
|
||||
|
||||
return self;
|
||||
|
||||
function focusedSpecName() {
|
||||
var specName;
|
||||
|
||||
(function memoizeFocusedSpec() {
|
||||
if (specName) {
|
||||
return;
|
||||
}
|
||||
|
||||
var paramMap = [];
|
||||
var params = doc.location.search.substring(1).split('&');
|
||||
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
var p = params[i].split('=');
|
||||
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
|
||||
}
|
||||
|
||||
specName = paramMap.spec;
|
||||
})();
|
||||
|
||||
return specName;
|
||||
}
|
||||
|
||||
function createReporterDom(version) {
|
||||
dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },
|
||||
dom.banner = self.createDom('div', { className: 'banner' },
|
||||
self.createDom('span', { className: 'title' }, "Jasmine "),
|
||||
self.createDom('span', { className: 'version' }, version)),
|
||||
|
||||
dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),
|
||||
dom.alert = self.createDom('div', {className: 'alert'}),
|
||||
dom.results = self.createDom('div', {className: 'results'},
|
||||
dom.summary = self.createDom('div', { className: 'summary' }),
|
||||
dom.details = self.createDom('div', { id: 'details' }))
|
||||
);
|
||||
}
|
||||
};
|
||||
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);jasmine.HtmlReporter.ReporterView = function(dom) {
|
||||
this.startedAt = new Date();
|
||||
this.runningSpecCount = 0;
|
||||
this.completeSpecCount = 0;
|
||||
this.passedCount = 0;
|
||||
this.failedCount = 0;
|
||||
this.skippedCount = 0;
|
||||
|
||||
this.createResultsMenu = function() {
|
||||
this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},
|
||||
this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'),
|
||||
' | ',
|
||||
this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing'));
|
||||
|
||||
this.summaryMenuItem.onclick = function() {
|
||||
dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');
|
||||
};
|
||||
|
||||
this.detailsMenuItem.onclick = function() {
|
||||
showDetails();
|
||||
};
|
||||
};
|
||||
|
||||
this.addSpecs = function(specs, specFilter) {
|
||||
this.totalSpecCount = specs.length;
|
||||
|
||||
this.views = {
|
||||
specs: {},
|
||||
suites: {}
|
||||
};
|
||||
|
||||
for (var i = 0; i < specs.length; i++) {
|
||||
var spec = specs[i];
|
||||
this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);
|
||||
if (specFilter(spec)) {
|
||||
this.runningSpecCount++;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.specComplete = function(spec) {
|
||||
this.completeSpecCount++;
|
||||
|
||||
if (isUndefined(this.views.specs[spec.id])) {
|
||||
this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);
|
||||
}
|
||||
|
||||
var specView = this.views.specs[spec.id];
|
||||
|
||||
switch (specView.status()) {
|
||||
case 'passed':
|
||||
this.passedCount++;
|
||||
break;
|
||||
|
||||
case 'failed':
|
||||
this.failedCount++;
|
||||
break;
|
||||
|
||||
case 'skipped':
|
||||
this.skippedCount++;
|
||||
break;
|
||||
}
|
||||
|
||||
specView.refresh();
|
||||
this.refresh();
|
||||
};
|
||||
|
||||
this.suiteComplete = function(suite) {
|
||||
var suiteView = this.views.suites[suite.id];
|
||||
if (isUndefined(suiteView)) {
|
||||
return;
|
||||
}
|
||||
suiteView.refresh();
|
||||
};
|
||||
|
||||
this.refresh = function() {
|
||||
|
||||
if (isUndefined(this.resultsMenu)) {
|
||||
this.createResultsMenu();
|
||||
}
|
||||
|
||||
// currently running UI
|
||||
if (isUndefined(this.runningAlert)) {
|
||||
this.runningAlert = this.createDom('a', {href: "?", className: "runningAlert bar"});
|
||||
dom.alert.appendChild(this.runningAlert);
|
||||
}
|
||||
this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount);
|
||||
|
||||
// skipped specs UI
|
||||
if (isUndefined(this.skippedAlert)) {
|
||||
this.skippedAlert = this.createDom('a', {href: "?", className: "skippedAlert bar"});
|
||||
}
|
||||
|
||||
this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
|
||||
|
||||
if (this.skippedCount === 1 && isDefined(dom.alert)) {
|
||||
dom.alert.appendChild(this.skippedAlert);
|
||||
}
|
||||
|
||||
// passing specs UI
|
||||
if (isUndefined(this.passedAlert)) {
|
||||
this.passedAlert = this.createDom('span', {href: "?", className: "passingAlert bar"});
|
||||
}
|
||||
this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount);
|
||||
|
||||
// failing specs UI
|
||||
if (isUndefined(this.failedAlert)) {
|
||||
this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"});
|
||||
}
|
||||
this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount);
|
||||
|
||||
if (this.failedCount === 1 && isDefined(dom.alert)) {
|
||||
dom.alert.appendChild(this.failedAlert);
|
||||
dom.alert.appendChild(this.resultsMenu);
|
||||
}
|
||||
|
||||
// summary info
|
||||
this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount);
|
||||
this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing";
|
||||
};
|
||||
|
||||
this.complete = function() {
|
||||
dom.alert.removeChild(this.runningAlert);
|
||||
|
||||
this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
|
||||
|
||||
if (this.failedCount === 0) {
|
||||
dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount)));
|
||||
} else {
|
||||
showDetails();
|
||||
}
|
||||
|
||||
dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"));
|
||||
};
|
||||
|
||||
return this;
|
||||
|
||||
function showDetails() {
|
||||
if (dom.reporter.className.search(/showDetails/) === -1) {
|
||||
dom.reporter.className += " showDetails";
|
||||
}
|
||||
}
|
||||
|
||||
function isUndefined(obj) {
|
||||
return typeof obj === 'undefined';
|
||||
}
|
||||
|
||||
function isDefined(obj) {
|
||||
return !isUndefined(obj);
|
||||
}
|
||||
|
||||
function specPluralizedFor(count) {
|
||||
var str = count + " spec";
|
||||
if (count > 1) {
|
||||
str += "s"
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView);
|
||||
|
||||
|
||||
jasmine.HtmlReporter.SpecView = function(spec, dom, views) {
|
||||
this.spec = spec;
|
||||
this.dom = dom;
|
||||
this.views = views;
|
||||
|
||||
this.symbol = this.createDom('li', { className: 'pending' });
|
||||
this.dom.symbolSummary.appendChild(this.symbol);
|
||||
|
||||
this.summary = this.createDom('div', { className: 'specSummary' },
|
||||
this.createDom('a', {
|
||||
className: 'description',
|
||||
href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
|
||||
title: this.spec.getFullName()
|
||||
}, this.spec.description)
|
||||
);
|
||||
|
||||
this.detail = this.createDom('div', { className: 'specDetail' },
|
||||
this.createDom('a', {
|
||||
className: 'description',
|
||||
href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
|
||||
title: this.spec.getFullName()
|
||||
}, this.spec.getFullName())
|
||||
);
|
||||
};
|
||||
|
||||
jasmine.HtmlReporter.SpecView.prototype.status = function() {
|
||||
return this.getSpecStatus(this.spec);
|
||||
};
|
||||
|
||||
jasmine.HtmlReporter.SpecView.prototype.refresh = function() {
|
||||
this.symbol.className = this.status();
|
||||
|
||||
switch (this.status()) {
|
||||
case 'skipped':
|
||||
break;
|
||||
|
||||
case 'passed':
|
||||
this.appendSummaryToSuiteDiv();
|
||||
break;
|
||||
|
||||
case 'failed':
|
||||
this.appendSummaryToSuiteDiv();
|
||||
this.appendFailureDetail();
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
|
||||
this.summary.className += ' ' + this.status();
|
||||
this.appendToSummary(this.spec, this.summary);
|
||||
};
|
||||
|
||||
jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {
|
||||
this.detail.className += ' ' + this.status();
|
||||
|
||||
var resultItems = this.spec.results().getItems();
|
||||
var messagesDiv = this.createDom('div', { className: 'messages' });
|
||||
|
||||
for (var i = 0; i < resultItems.length; i++) {
|
||||
var result = resultItems[i];
|
||||
|
||||
if (result.type == 'log') {
|
||||
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
|
||||
} else if (result.type == 'expect' && result.passed && !result.passed()) {
|
||||
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
|
||||
|
||||
if (result.trace.stack) {
|
||||
messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (messagesDiv.childNodes.length > 0) {
|
||||
this.detail.appendChild(messagesDiv);
|
||||
this.dom.details.appendChild(this.detail);
|
||||
}
|
||||
};
|
||||
|
||||
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);jasmine.HtmlReporter.SuiteView = function(suite, dom, views) {
|
||||
this.suite = suite;
|
||||
this.dom = dom;
|
||||
this.views = views;
|
||||
|
||||
this.element = this.createDom('div', { className: 'suite' },
|
||||
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(this.suite.getFullName()) }, this.suite.description)
|
||||
);
|
||||
|
||||
this.appendToSummary(this.suite, this.element);
|
||||
};
|
||||
|
||||
jasmine.HtmlReporter.SuiteView.prototype.status = function() {
|
||||
return this.getSpecStatus(this.suite);
|
||||
};
|
||||
|
||||
jasmine.HtmlReporter.SuiteView.prototype.refresh = function() {
|
||||
this.element.className += " " + this.status();
|
||||
};
|
||||
|
||||
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);
|
||||
|
||||
/* @deprecated Use jasmine.HtmlReporter instead
|
||||
*/
|
||||
jasmine.TrivialReporter = function(doc) {
|
||||
this.document = doc || document;
|
||||
this.suiteDivs = {};
|
||||
this.logRunningSpecs = false;
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
|
||||
var el = document.createElement(type);
|
||||
|
||||
for (var i = 2; i < arguments.length; i++) {
|
||||
var child = arguments[i];
|
||||
|
||||
if (typeof child === 'string') {
|
||||
el.appendChild(document.createTextNode(child));
|
||||
} else {
|
||||
if (child) { el.appendChild(child); }
|
||||
}
|
||||
}
|
||||
|
||||
for (var attr in attrs) {
|
||||
if (attr == "className") {
|
||||
el[attr] = attrs[attr];
|
||||
} else {
|
||||
el.setAttribute(attr, attrs[attr]);
|
||||
}
|
||||
}
|
||||
|
||||
return el;
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
|
||||
var showPassed, showSkipped;
|
||||
|
||||
this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' },
|
||||
this.createDom('div', { className: 'banner' },
|
||||
this.createDom('div', { className: 'logo' },
|
||||
this.createDom('span', { className: 'title' }, "Jasmine"),
|
||||
this.createDom('span', { className: 'version' }, runner.env.versionString())),
|
||||
this.createDom('div', { className: 'options' },
|
||||
"Show ",
|
||||
showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
|
||||
this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
|
||||
showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
|
||||
this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
|
||||
)
|
||||
),
|
||||
|
||||
this.runnerDiv = this.createDom('div', { className: 'runner running' },
|
||||
this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
|
||||
this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
|
||||
this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
|
||||
);
|
||||
|
||||
this.document.body.appendChild(this.outerDiv);
|
||||
|
||||
var suites = runner.suites();
|
||||
for (var i = 0; i < suites.length; i++) {
|
||||
var suite = suites[i];
|
||||
var suiteDiv = this.createDom('div', { className: 'suite' },
|
||||
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
|
||||
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
|
||||
this.suiteDivs[suite.id] = suiteDiv;
|
||||
var parentDiv = this.outerDiv;
|
||||
if (suite.parentSuite) {
|
||||
parentDiv = this.suiteDivs[suite.parentSuite.id];
|
||||
}
|
||||
parentDiv.appendChild(suiteDiv);
|
||||
}
|
||||
|
||||
this.startedAt = new Date();
|
||||
|
||||
var self = this;
|
||||
showPassed.onclick = function(evt) {
|
||||
if (showPassed.checked) {
|
||||
self.outerDiv.className += ' show-passed';
|
||||
} else {
|
||||
self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
|
||||
}
|
||||
};
|
||||
|
||||
showSkipped.onclick = function(evt) {
|
||||
if (showSkipped.checked) {
|
||||
self.outerDiv.className += ' show-skipped';
|
||||
} else {
|
||||
self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
|
||||
var results = runner.results();
|
||||
var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
|
||||
this.runnerDiv.setAttribute("class", className);
|
||||
//do it twice for IE
|
||||
this.runnerDiv.setAttribute("className", className);
|
||||
var specs = runner.specs();
|
||||
var specCount = 0;
|
||||
for (var i = 0; i < specs.length; i++) {
|
||||
if (this.specFilter(specs[i])) {
|
||||
specCount++;
|
||||
}
|
||||
}
|
||||
var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
|
||||
message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
|
||||
this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
|
||||
|
||||
this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
|
||||
var results = suite.results();
|
||||
var status = results.passed() ? 'passed' : 'failed';
|
||||
if (results.totalCount === 0) { // todo: change this to check results.skipped
|
||||
status = 'skipped';
|
||||
}
|
||||
this.suiteDivs[suite.id].className += " " + status;
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
|
||||
if (this.logRunningSpecs) {
|
||||
this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
|
||||
}
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
|
||||
var results = spec.results();
|
||||
var status = results.passed() ? 'passed' : 'failed';
|
||||
if (results.skipped) {
|
||||
status = 'skipped';
|
||||
}
|
||||
var specDiv = this.createDom('div', { className: 'spec ' + status },
|
||||
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
|
||||
this.createDom('a', {
|
||||
className: 'description',
|
||||
href: '?spec=' + encodeURIComponent(spec.getFullName()),
|
||||
title: spec.getFullName()
|
||||
}, spec.description));
|
||||
|
||||
|
||||
var resultItems = results.getItems();
|
||||
var messagesDiv = this.createDom('div', { className: 'messages' });
|
||||
for (var i = 0; i < resultItems.length; i++) {
|
||||
var result = resultItems[i];
|
||||
|
||||
if (result.type == 'log') {
|
||||
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
|
||||
} else if (result.type == 'expect' && result.passed && !result.passed()) {
|
||||
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
|
||||
|
||||
if (result.trace.stack) {
|
||||
messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (messagesDiv.childNodes.length > 0) {
|
||||
specDiv.appendChild(messagesDiv);
|
||||
}
|
||||
|
||||
this.suiteDivs[spec.suite.id].appendChild(specDiv);
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.log = function() {
|
||||
var console = jasmine.getGlobal().console;
|
||||
if (console && console.log) {
|
||||
if (console.log.apply) {
|
||||
console.log.apply(console, arguments);
|
||||
} else {
|
||||
console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.getLocation = function() {
|
||||
return this.document.location;
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.specFilter = function(spec) {
|
||||
var paramMap = {};
|
||||
var params = this.getLocation().search.substring(1).split('&');
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
var p = params[i].split('=');
|
||||
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
|
||||
}
|
||||
|
||||
if (!paramMap.spec) {
|
||||
return true;
|
||||
}
|
||||
return spec.getFullName().indexOf(paramMap.spec) === 0;
|
||||
};
|
|
@ -1,81 +0,0 @@
|
|||
body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; }
|
||||
|
||||
#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; }
|
||||
#HTMLReporter a { text-decoration: none; }
|
||||
#HTMLReporter a:hover { text-decoration: underline; }
|
||||
#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; }
|
||||
#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; }
|
||||
#HTMLReporter #jasmine_content { position: fixed; right: 100%; }
|
||||
#HTMLReporter .version { color: #aaaaaa; }
|
||||
#HTMLReporter .banner { margin-top: 14px; }
|
||||
#HTMLReporter .duration { color: #aaaaaa; float: right; }
|
||||
#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; }
|
||||
#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; }
|
||||
#HTMLReporter .symbolSummary li.passed { font-size: 14px; }
|
||||
#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; }
|
||||
#HTMLReporter .symbolSummary li.failed { line-height: 9px; }
|
||||
#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; }
|
||||
#HTMLReporter .symbolSummary li.skipped { font-size: 14px; }
|
||||
#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; }
|
||||
#HTMLReporter .symbolSummary li.pending { line-height: 11px; }
|
||||
#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; }
|
||||
#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
|
||||
#HTMLReporter .runningAlert { background-color: #666666; }
|
||||
#HTMLReporter .skippedAlert { background-color: #aaaaaa; }
|
||||
#HTMLReporter .skippedAlert:first-child { background-color: #333333; }
|
||||
#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; }
|
||||
#HTMLReporter .passingAlert { background-color: #a6b779; }
|
||||
#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; }
|
||||
#HTMLReporter .failingAlert { background-color: #cf867e; }
|
||||
#HTMLReporter .failingAlert:first-child { background-color: #b03911; }
|
||||
#HTMLReporter .results { margin-top: 14px; }
|
||||
#HTMLReporter #details { display: none; }
|
||||
#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; }
|
||||
#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; }
|
||||
#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; }
|
||||
#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; }
|
||||
#HTMLReporter.showDetails .summary { display: none; }
|
||||
#HTMLReporter.showDetails #details { display: block; }
|
||||
#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; }
|
||||
#HTMLReporter .summary { margin-top: 14px; }
|
||||
#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; }
|
||||
#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; }
|
||||
#HTMLReporter .summary .specSummary.failed a { color: #b03911; }
|
||||
#HTMLReporter .description + .suite { margin-top: 0; }
|
||||
#HTMLReporter .suite { margin-top: 14px; }
|
||||
#HTMLReporter .suite a { color: #333333; }
|
||||
#HTMLReporter #details .specDetail { margin-bottom: 28px; }
|
||||
#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; }
|
||||
#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; }
|
||||
#HTMLReporter .resultMessage span.result { display: block; }
|
||||
#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; }
|
||||
|
||||
#TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ }
|
||||
#TrivialReporter a:visited, #TrivialReporter a { color: #303; }
|
||||
#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; }
|
||||
#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; }
|
||||
#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; }
|
||||
#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; }
|
||||
#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; }
|
||||
#TrivialReporter .runner.running { background-color: yellow; }
|
||||
#TrivialReporter .options { text-align: right; font-size: .8em; }
|
||||
#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; }
|
||||
#TrivialReporter .suite .suite { margin: 5px; }
|
||||
#TrivialReporter .suite.passed { background-color: #dfd; }
|
||||
#TrivialReporter .suite.failed { background-color: #fdd; }
|
||||
#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; }
|
||||
#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; }
|
||||
#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; }
|
||||
#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; }
|
||||
#TrivialReporter .spec.skipped { background-color: #bbb; }
|
||||
#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; }
|
||||
#TrivialReporter .passed { background-color: #cfc; display: none; }
|
||||
#TrivialReporter .failed { background-color: #fbb; }
|
||||
#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; }
|
||||
#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; }
|
||||
#TrivialReporter .resultMessage .mismatch { color: black; }
|
||||
#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; }
|
||||
#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; }
|
||||
#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; }
|
||||
#TrivialReporter #jasmine_content { position: fixed; right: 100%; }
|
||||
#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; }
|
File diff suppressed because it is too large
Load Diff
|
@ -1,31 +0,0 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>End2end Test Runner</title>
|
||||
<link rel="stylesheet" type="text/css" href="lib/jasmine/jasmine.css" />
|
||||
<script src="../lib/jquery-1.9.1.js" ng-autotest></script>
|
||||
<script src="../lib/angular.js" ng-autotest></script>
|
||||
<script src="lib/jasmine/jasmine.js" ng-autotest></script>
|
||||
<script src="lib/jasmine/jasmine-html.js" ng-autotest></script>
|
||||
<script src="lib/angular/angular-mocks.js" ng-autotest></script>
|
||||
<script src="../build/ng-grid.debug.js" ng-autotest></script>
|
||||
<script src="unit/servicesSpec.js"></script>
|
||||
<script src="unit/filtersSpec.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
// KICK OFF JASMINE
|
||||
var jasmineEnv = jasmine.getEnv();
|
||||
var trivialReporter = new jasmine.TrivialReporter();
|
||||
|
||||
jasmineEnv.addReporter(trivialReporter);
|
||||
|
||||
jasmineEnv.specFilter = function(spec) {
|
||||
return trivialReporter.specFilter(spec);
|
||||
};
|
||||
|
||||
jasmineEnv.execute();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,79 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
|
||||
|
||||
describe('PhoneCat App', function() {
|
||||
|
||||
it('should redirect index.html to index.html#/phones', function() {
|
||||
browser().navigateTo('../../app/index.html');
|
||||
expect(browser().location().url()).toBe('/phones');
|
||||
});
|
||||
|
||||
|
||||
describe('Phone list view', function() {
|
||||
|
||||
beforeEach(function() {
|
||||
browser().navigateTo('../../app/index.html#/phones');
|
||||
});
|
||||
|
||||
|
||||
it('should filter the phone list as user types into the search box', function() {
|
||||
expect(repeater('.phones li').count()).toBe(20);
|
||||
|
||||
input('query').enter('nexus');
|
||||
expect(repeater('.phones li').count()).toBe(1);
|
||||
|
||||
input('query').enter('motorola');
|
||||
expect(repeater('.phones li').count()).toBe(8);
|
||||
});
|
||||
|
||||
|
||||
it('should be possible to control phone order via the drop down select box', function() {
|
||||
input('query').enter('tablet'); //let's narrow the dataset to make the test assertions shorter
|
||||
|
||||
expect(repeater('.phones li', 'Phone List').column('phone.name')).
|
||||
toEqual(["Motorola XOOM\u2122 with Wi-Fi",
|
||||
"MOTOROLA XOOM\u2122"]);
|
||||
|
||||
select('orderProp').option('Alphabetical');
|
||||
|
||||
expect(repeater('.phones li', 'Phone List').column('phone.name')).
|
||||
toEqual(["MOTOROLA XOOM\u2122",
|
||||
"Motorola XOOM\u2122 with Wi-Fi"]);
|
||||
});
|
||||
|
||||
|
||||
it('should render phone specific links', function() {
|
||||
input('query').enter('nexus');
|
||||
element('.phones li a').click();
|
||||
expect(browser().location().url()).toBe('/phones/nexus-s');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('Phone detail view', function() {
|
||||
|
||||
beforeEach(function() {
|
||||
browser().navigateTo('../../app/index.html#/phones/nexus-s');
|
||||
});
|
||||
|
||||
|
||||
it('should display nexus-s page', function() {
|
||||
expect(binding('phone.name')).toBe('Nexus S');
|
||||
});
|
||||
|
||||
|
||||
it('should display the first phone image as the main phone image', function() {
|
||||
expect(element('img.phone').attr('src')).toBe('img/phones/nexus-s.0.jpg');
|
||||
});
|
||||
|
||||
|
||||
it('should swap main image if a thumbnail image is clicked on', function() {
|
||||
element('.phone-thumbs li:nth-child(3) img').click();
|
||||
expect(element('img.phone').attr('src')).toBe('img/phones/nexus-s.2.jpg');
|
||||
|
||||
element('.phone-thumbs li:nth-child(1) img').click();
|
||||
expect(element('img.phone').attr('src')).toBe('img/phones/nexus-s.0.jpg');
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,160 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
/* jasmine specs for directives go here */
|
||||
|
||||
describe('directives', function () {
|
||||
var $dUtils;
|
||||
var $scope;
|
||||
var $linker;
|
||||
var $cache;
|
||||
beforeEach(module('ngGrid'));
|
||||
beforeEach(inject(function ($rootScope, $domUtilityService, $templateCache, $compile) {
|
||||
$scope = $rootScope.$new();
|
||||
$dUtils = $domUtilityService;
|
||||
$linker = $compile;
|
||||
$cache = $templateCache;
|
||||
}));
|
||||
|
||||
describe('ng-cell-has-focus', function() {
|
||||
it('should do something', function() {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('ng-cell-text', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('ng-cell', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
|
||||
describe('ng-header-cell', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('ng-header-row', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('ng-if', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('ng-input', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('ng-row', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('ng-viewport', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('ng-grid', function () {
|
||||
describe('grid classes', function () {
|
||||
describe('aggregate', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('column', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('domAccessProvider', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('eventProvider', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('footer', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('grid', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('row', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('rowFactory', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('searchProvider', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('selectionProvider', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('styleProvider', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
});
|
||||
describe('templates', function () {
|
||||
describe('aggregateTemplate', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('checkboxCellTemplate', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('checkboxHeaderTemplate', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('headerRowTemplate', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('rowTemplate', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
});
|
||||
describe('scope functions', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
describe('grid functions', function () {
|
||||
it('should do something', function () {
|
||||
//add work here
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,29 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
/* jasmine specs for filters go here */
|
||||
|
||||
describe('filter', function() {
|
||||
var $checkmark;
|
||||
var $columns;
|
||||
beforeEach(module('ngGrid.filters'));
|
||||
beforeEach(inject(function($filter) {
|
||||
$checkmark = $filter('checkmark');
|
||||
$columns = $filter('ngColumns');
|
||||
}));
|
||||
|
||||
|
||||
describe('checkmark filter', function() {
|
||||
it('returns the appropriate unicode character based on a boolean value', function() {
|
||||
expect($checkmark(true)).toEqual('\u2714');
|
||||
expect($checkmark(false)).toEqual('\u2718');
|
||||
});
|
||||
});
|
||||
|
||||
describe('ngColumns filter', function() {
|
||||
it('returns columns that are not aggregate columns', function() {
|
||||
var columns = [{ isAggCol: true }, { isAggCol: true }, { isAggCol: false }, { isAggCol: false }, { isAggCol: false }];
|
||||
var fCols = $columns(columns);
|
||||
expect(fCols.length).toEqual(3);
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,209 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
/* jasmine specs for services go here */
|
||||
describe('Dom Utility Service', function () {
|
||||
var $dUtils;
|
||||
var $scope;
|
||||
var $linker;
|
||||
var $cache;
|
||||
beforeEach(module('ngGrid'));
|
||||
beforeEach(inject(function ($rootScope, $domUtilityService, $templateCache, $compile) {
|
||||
$scope = $rootScope.$new();
|
||||
$dUtils = $domUtilityService;
|
||||
$linker = $compile;
|
||||
$cache = $templateCache;
|
||||
}));
|
||||
|
||||
// AssignGridContainers
|
||||
describe('AssignGridContainers', function () {
|
||||
it('should should find the correct elements and assign them in the grid properly', function () {
|
||||
var domsizesCalled;
|
||||
var grid = {
|
||||
elementDims: {},
|
||||
refreshDomSizes: function () {
|
||||
domsizesCalled = true;
|
||||
}
|
||||
};
|
||||
$scope.adjustScrollTop = function(top) {
|
||||
expect(top).toEqual(grid.$canvas.scrollTop());
|
||||
};
|
||||
var root = angular.element('<div class="ng-scope ngGrid"></div>');
|
||||
root.append(angular.element($cache.get('gridTemplate.html')));
|
||||
$dUtils.AssignGridContainers($scope, root, grid);
|
||||
|
||||
expect(grid.$root.is(".ngGrid")).toEqual(true);
|
||||
expect(grid.$root.length).toEqual(1);
|
||||
expect(grid.$topPanel.is(".ngTopPanel")).toEqual(true);
|
||||
expect(grid.$topPanel.length).toEqual(1);
|
||||
expect(grid.$groupPanel.is(".ngGroupPanel")).toEqual(true);
|
||||
expect(grid.$groupPanel.length).toEqual(1);
|
||||
expect(grid.$headerContainer.is(".ngHeaderContainer")).toEqual(true);
|
||||
expect(grid.$headerContainer.length).toEqual(1);
|
||||
expect(grid.$headerScroller.is(".ngHeaderScroller")).toEqual(true);
|
||||
expect(grid.$headerScroller.length).toEqual(1);
|
||||
expect(grid.$viewport.is(".ngViewport")).toEqual(true);
|
||||
expect(grid.$viewport.length).toEqual(1);
|
||||
expect(grid.$canvas.is(".ngCanvas")).toEqual(true);
|
||||
expect(grid.$canvas.length).toEqual(1);
|
||||
expect(grid.$footerPanel.is(".ngFooterPanel")).toEqual(true);
|
||||
expect(grid.$footerPanel.length).toEqual(1);
|
||||
expect(grid.elementDims.rootMaxH).toEqual(grid.$root.height());
|
||||
expect(domsizesCalled).toEqual(true);
|
||||
});
|
||||
});
|
||||
// BuildStyles
|
||||
describe('BuildStyles', function () {
|
||||
it('should set the $styleSheet object of the grid to be a stylesheet object with CSS', function () {
|
||||
var domsizesCalled;
|
||||
var scrollLeftCalled;
|
||||
var scrollTopCalled;
|
||||
|
||||
$scope.columns = [
|
||||
{ visible: true, pinned: false, width: 100, },
|
||||
{ visible: true, pinned: false, width: 100, },
|
||||
{ visible: true, pinned: false, width: 100, },
|
||||
{ visible: true, pinned: false, width: 100, }];
|
||||
$scope.totalRowWidth = function() {
|
||||
return 400;
|
||||
};
|
||||
$scope.adjustScrollLeft = function () {
|
||||
scrollLeftCalled = true;
|
||||
};
|
||||
$scope.adjustScrollTop = function () {
|
||||
scrollTopCalled = true;
|
||||
};
|
||||
|
||||
var root = angular.element('<div class="ng-scope ngGrid"></div>');
|
||||
root.append(angular.element($cache.get('gridTemplate.html')));
|
||||
var grid = {
|
||||
config: {
|
||||
rowHeight: 30
|
||||
},
|
||||
gridId: 1,
|
||||
elementDims: {},
|
||||
refreshDomSizes: function () {
|
||||
domsizesCalled = true;
|
||||
}
|
||||
};
|
||||
$dUtils.AssignGridContainers($scope, root, grid);
|
||||
$dUtils.BuildStyles($scope, grid, true);
|
||||
var temp = grid.$styleSheet.html();
|
||||
expect(domsizesCalled).toEqual(true);
|
||||
expect(scrollLeftCalled).toEqual(true);
|
||||
expect(scrollTopCalled).toEqual(true);
|
||||
expect(temp).toEqual(".1 .ngCanvas { width: 400px; }.1 .ngRow { width: 400px; }.1 .ngCanvas { width: 400px; }.1 .ngHeaderScroller { width: 419px}.1 .col0 { width: 100px; left: 0px; height: 30px }.1 .colt0 { width: 100px; }.1 .col1 { width: 100px; left: 100px; height: 30px }.1 .colt1 { width: 100px; }.1 .col2 { width: 100px; left: 200px; height: 30px }.1 .colt2 { width: 100px; }.1 .col3 { width: 100px; left: 300px; height: 30px }.1 .colt3 { width: 100px; }")
|
||||
});
|
||||
});
|
||||
// setColLeft
|
||||
describe('setColLeft', function () {
|
||||
it('should set the left positioning of the specified column to the given integer', function () {
|
||||
$scope.columns = [
|
||||
{ visible: true, pinned: false, width: 100, index: 0 },
|
||||
{ visible: true, pinned: false, width: 100, index: 1 },
|
||||
{ visible: true, pinned: false, width: 100, index: 2 },
|
||||
{ visible: true, pinned: false, width: 100, index: 3 }];
|
||||
$scope.totalRowWidth = function () {return 400;};
|
||||
$scope.adjustScrollLeft = function () {};
|
||||
$scope.adjustScrollTop = function () {};
|
||||
var root = angular.element('<div class="ng-scope ngGrid"></div>');
|
||||
root.append(angular.element($cache.get('gridTemplate.html')));
|
||||
var grid = {
|
||||
config: {
|
||||
rowHeight: 30
|
||||
},
|
||||
gridId: 1,
|
||||
elementDims: {},
|
||||
refreshDomSizes: function () {}
|
||||
};
|
||||
$dUtils.AssignGridContainers($scope, root, grid);
|
||||
$dUtils.BuildStyles($scope, grid, true);
|
||||
$dUtils.setColLeft($scope.columns[0], 300, grid);
|
||||
var temp = grid.$styleSheet.html();
|
||||
expect(temp).toEqual(".1 .ngCanvas { width: 400px; }.1 .ngRow { width: 400px; }.1 .ngCanvas { width: 400px; }.1 .ngHeaderScroller { width: 419px}.1 .col0 { width: 100px; left: 300px; height: 30px }.1 .colt0 { width: 100px; }.1 .col1 { width: 100px; left: 100px; height: 30px }.1 .colt1 { width: 100px; }.1 .col2 { width: 100px; left: 200px; height: 30px }.1 .colt2 { width: 100px; }.1 .col3 { width: 100px; left: 300px; height: 30px }.1 .colt3 { width: 100px; }")
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Sort Service', function () {
|
||||
var $sort;
|
||||
beforeEach(module('ngGrid'));
|
||||
beforeEach(inject(function ($sortService) {
|
||||
$sort = $sortService;
|
||||
}));
|
||||
});
|
||||
|
||||
describe('Utility Service', function () {
|
||||
var $utils;
|
||||
beforeEach(module('ngGrid'));
|
||||
beforeEach(inject(function ($utilityService) {
|
||||
$utils = $utilityService;
|
||||
}));
|
||||
// evalProperty
|
||||
describe('evalProperty should find the right property given a heirarchy.', function () {
|
||||
// foundme
|
||||
it('returns foundme', function() {
|
||||
var obj = { foo: { bar: { hello: { world: "foundme" } } } };
|
||||
expect($utils.evalProperty(obj, "foo.bar.hello.world")).toEqual("foundme");
|
||||
});
|
||||
// undefined
|
||||
it('returns undefined', function () {
|
||||
var obj = { foo: { bar: { hello: { world: "foundme" } } } };
|
||||
expect($utils.evalProperty(obj, "foo.bar.omg")).toEqual(undefined);
|
||||
});
|
||||
});
|
||||
// visualLength
|
||||
describe('visualLength should return the correct visual length of text.', function () {
|
||||
it('returns integer', function() {
|
||||
var node = angular.element('<div style="width: 30px;">The quick brown fox jumped over the lazy dog.</div>');
|
||||
expect($utils.visualLength(node)).toEqual(286);
|
||||
});
|
||||
});
|
||||
// forIn
|
||||
describe('forIn should execute the function for each key in an object.', function() {
|
||||
it('executes some code', function () {
|
||||
var obj = {
|
||||
foo: "foo",
|
||||
bar: "bar",
|
||||
hello: "hello",
|
||||
world: "world"
|
||||
};
|
||||
|
||||
$utils.forIn(obj, function (val, key) {
|
||||
obj[key] = "foundme";
|
||||
});
|
||||
expect(obj.foo).toEqual("foundme");
|
||||
expect(obj.bar).toEqual("foundme");
|
||||
expect(obj.hello).toEqual("foundme");
|
||||
expect(obj.world).toEqual("foundme");
|
||||
});
|
||||
});
|
||||
// endsWith
|
||||
describe('endsWith should return true or false based on the last character in a string', function () {
|
||||
var str = "Peter Piper picked a peck of pickeled peppers";
|
||||
it('returns true', function() {
|
||||
|
||||
expect($utils.endsWith(str, "peppers")).toEqual(true);
|
||||
});
|
||||
it('returns false', function () {
|
||||
expect($utils.endsWith(str, "peter")).toEqual(false);
|
||||
});
|
||||
});
|
||||
// isNullOrUndefined
|
||||
describe('isNullOrUndefined return true or false based on wherer or not a given reference is explucitly null or undefined', function () {
|
||||
it('returns true', function () {
|
||||
var hello;
|
||||
expect($utils.isNullOrUndefined(hello)).toEqual(true);
|
||||
var hello = null;
|
||||
expect($utils.isNullOrUndefined(hello)).toEqual(true);
|
||||
var hello = undefined;
|
||||
expect($utils.isNullOrUndefined(hello)).toEqual(true);
|
||||
expect($utils.isNullOrUndefined(null)).toEqual(true);
|
||||
expect($utils.isNullOrUndefined(undefined)).toEqual(true);
|
||||
});
|
||||
it('returns false', function () {
|
||||
expect($utils.isNullOrUndefined("foundme")).toEqual(false);
|
||||
expect($utils.isNullOrUndefined("")).toEqual(false);
|
||||
expect($utils.isNullOrUndefined(0)).toEqual(false);
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,45 +0,0 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>ng-grid workbench</title>
|
||||
<link rel="stylesheet" type="text/css" href="../lib/bootstrap/css/bootstrap.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../ng-grid.css" />
|
||||
<script type="text/javascript" src="largeLoad.js"></script>
|
||||
<script type="text/javascript" src="largeTestData.js"></script>
|
||||
<script type="text/javascript" src="../lib/jquery-1.9.1.js"></script>
|
||||
<script type="text/javascript" src="../lib/jquery-ui-1.9.1.custom.min.js"></script>
|
||||
<script type="text/javascript" src="../lib/angular.js"></script>
|
||||
<script type="text/javascript" src="../lib/bootstrap/js/bootstrap.js"></script>
|
||||
<script type="text/javascript" src="../build/ng-grid.debug.js"></script>
|
||||
<script type="text/javascript" src="main.js"></script>
|
||||
<script>
|
||||
angular.module('myApp',['ngGrid']);
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.ngRow.selected {
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
background-color: #76b617;
|
||||
background-image: -webkit-linear-gradient(top, #76b617, #638911);
|
||||
background-image: -moz-linear-gradient(top, #76b617, #638911);
|
||||
background-image: -o-linear-gradient(top, #76b617, #638911);
|
||||
background-image: -ms-linear-gradient(top, #76b617, #638911);
|
||||
background-image: linear-gradient(top, #76b617, #638911);
|
||||
-webkit-border-radius: 4px 4px 4px 4px;
|
||||
-moz-border-radius: 4px 4px 4px 4px;
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body ng-app="myApp" ng-controller="userController" >
|
||||
<div id="parent" style="position: absolute; top: 0; bottom: 0; left:0; right: 0;">
|
||||
<div style="width: 1600px; height: 600px;" ng-grid="gridOptions">
|
||||
</div>
|
||||
</div>
|
||||
<div>{{mySelections | json}}</div>
|
||||
<button ng-click="checkData()">Check Data</button>
|
||||
<button ng-click="Add()">Insert Rows</button>
|
||||
<button ng-click="changeLang()">change Language</button>
|
||||
<button ng-click="setSelection()">set Selections</button>
|
||||
</body>
|
||||
</html>
|
|
@ -1,35 +0,0 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>ng-grid workbench</title>
|
||||
<link rel="stylesheet" type="text/css" href="../lib/bootstrap/css/bootstrap.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../ng-grid.css" />
|
||||
|
||||
<script type="text/javascript" src="largeLoad.js"></script>
|
||||
<script type="text/javascript" src="largeTestData.js"></script>
|
||||
<script type="text/javascript" src="../lib/jquery-1.9.1.js"></script>
|
||||
<script type="text/javascript" src="../lib/jquery-ui-1.9.1.custom.min.js"></script>
|
||||
<script type="text/javascript" src="../lib/angular.js"></script>
|
||||
<script type="text/javascript" src="../lib/bootstrap/js/bootstrap.js"></script>
|
||||
<script type="text/javascript" src="../build/ng-grid.debug.js"></script>
|
||||
<script type="text/javascript" src="main.js"></script>
|
||||
<script>
|
||||
angular.module('myApp',['ngGrid']);
|
||||
</script>
|
||||
</head>
|
||||
<body ng-app="myApp" ng-controller="userController">
|
||||
<div style="width: 800px; height: 400px;" ng-grid="gridOptions2">
|
||||
</div>
|
||||
<div>{{mySelections2}}</div>
|
||||
<button ng-click="changeData()">pop</button>
|
||||
|
||||
<button ng-click="resetData()">reset</button>
|
||||
<button ng-click="spliceData()">splice</button>
|
||||
<button ng-click="modifyData()">modify</button>
|
||||
<button ng-click="setSelection()">set Selection</button>
|
||||
|
||||
<!-- <div style="margin: 10px; width: 600px; height: 400px;" ng-grid="gridOptions2">
|
||||
</div>
|
||||
<span>mySelections2: {{mySelections2 | json}}</span>-->
|
||||
</body>
|
||||
</html>
|
|
@ -1,32 +0,0 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>ng-grid workbench</title>
|
||||
<link rel="stylesheet" type="text/css" href="../lib/bootstrap/css/bootstrap.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../ng-grid.css" />
|
||||
|
||||
<script type="text/javascript" src="largeLoad.js"></script>
|
||||
<script type="text/javascript" src="largeTestData.js"></script>
|
||||
<script type="text/javascript" src="../lib/jquery-1.9.1.js"></script>
|
||||
<script type="text/javascript" src="../lib/jquery-ui-1.9.1.custom.min.js"></script>
|
||||
<script type="text/javascript" src="../lib/jquery.layout-latest.min.js"></script>
|
||||
<script type="text/javascript" src="../lib/angular.js"></script>
|
||||
<script type="text/javascript" src="../lib/bootstrap/js/bootstrap.js"></script>
|
||||
<script type="text/javascript" src="../plugins/ng-grid-layout.js"></script>
|
||||
<script type="text/javascript" src="../build/ng-grid.debug.js"></script>
|
||||
<script type="text/javascript" src="layoutMain.js"></script>
|
||||
<script>
|
||||
angular.module('myApp',['ngGrid']);
|
||||
</script>
|
||||
</head>
|
||||
<body ng-app="myApp" ng-controller="userController">
|
||||
<div class="ui-layout-center">Center
|
||||
<div style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; overflow: hidden" ng-grid="gridOptions">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-layout-north">North</div>
|
||||
<div class="ui-layout-south">South</div>
|
||||
<div class="ui-layout-east">East</div>
|
||||
<div class="ui-layout-west">West</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,25 +0,0 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>ng-grid workbench</title>
|
||||
<link rel="stylesheet" type="text/css" href="../lib/bootstrap/css/bootstrap.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../ng-grid.css" />
|
||||
<script type="text/javascript" src="largeLoad.js"></script>
|
||||
<script type="text/javascript" src="largeTestData.js"></script>
|
||||
<script type="text/javascript" src="../lib/jquery-1.9.1.js"></script>
|
||||
<script type="text/javascript" src="../lib/jquery-ui-1.9.1.custom.min.js"></script>
|
||||
<script type="text/javascript" src="../lib/angular.js"></script>
|
||||
<script type="text/javascript" src="../lib/bootstrap/js/bootstrap.js"></script>
|
||||
<script type="text/javascript" src="../build/ng-grid.debug.js"></script>
|
||||
<script type="text/javascript" src="main.js"></script>
|
||||
<script>
|
||||
angular.module('myApp',['ngGrid']);
|
||||
</script>
|
||||
</head>
|
||||
<body ng-app="myApp" ng-controller="userController">
|
||||
<div style="width: 400px; height: 600px;" ng-grid="gridOptions2">
|
||||
</div>
|
||||
<p>{{mySelections2[0].Sku}}</p>
|
||||
<button ng-click="modifyData()">Modify Data</button>
|
||||
</body>
|
||||
</html>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue