')}]);
\ No newline at end of file
diff --git a/ng-tasty.js b/ng-tasty.js
index ac4c934..28f0425 100644
--- a/ng-tasty.js
+++ b/ng-tasty.js
@@ -2,7 +2,7 @@
* ng-tasty
* https://github.com/Zizzamia/ng-tasty
- * Version: 0.2.2-rc.1 - 2014-08-07
+ * Version: 0.2.2 - 2014-08-07
* License: MIT
*/
angular.module("ngTasty", ["ngTasty.table"]);
@@ -166,7 +166,7 @@ angular.module('ngTasty.table', [])
restrict: 'AE',
require: '^tastyTable',
scope: {},
- templateUrl: 'template/table/tasty-head.html',
+ templateUrl: 'template/table/head.html',
link: function (scope, element, attrs, tastyTable) {
'use strict';
var cleanFieldName, setFields, init;
@@ -251,7 +251,7 @@ angular.module('ngTasty.table', [])
restrict: 'AE',
require: '^tastyTable',
scope: {},
- templateUrl: 'template/table/tasty-pagination.html',
+ templateUrl: 'template/table/pagination.html',
link: function (scope, element, attrs, tastyTable) {
'use strict';
var getPage, setCount, setPaginationRange,
diff --git a/ng-tasty.min.js b/ng-tasty.min.js
index bd2229f..ffbc6de 100644
--- a/ng-tasty.min.js
+++ b/ng-tasty.min.js
@@ -1 +1 @@
-angular.module("ngTasty",["ngTasty.table"]),angular.module("ngTasty.table",[]).directive("tastyTable",["$timeout",function(){return{restrict:"A",scope:!0,controller:function(e){this.$scope=e},link:function(e,a,n){"use strict";var t;if(!n.resource)throw"AngularJS tastyTable directive: miss the resource attribute";if(!e[n.resource])throw"AngularJS tastyTable directive: the resource ("+n.resource+") callback it's undefined";e.query={page:"page",count:"count",sortBy:"sort-by",sortOrder:"sort-order"},e.header={columns:[]},e.rows=[],e.params={},e.thead=!1,e.pagination=!1,e.resourcePagination={},e.url="",e.setDirectivesValues=function(a){return a?(e.rows=a.rows,e.header={columns:a.header,sortBy:a.sortBy,sortOrder:a.sortOrder},void(e.resourcePagination=a.pagination)):!1},e.setProperty=function(e,a,n){return a[n]&&(e[n]=a[n]),e},e.joinObjects=function(a,n){for(var t in n)e.setProperty(a,n,t);return a},e.buildUrl=function(a,t){var r,i;return r={},e.thead&&(r=e.setProperty(r,a,"sortBy"),r=e.setProperty(r,a,"sortOrder")),e.pagination&&(r=e.setProperty(r,a,"page"),r=e.setProperty(r,a,"count")),n.filters&&(r=e.joinObjects(r,t)),Object.keys(r).map(function(a){return i=r[a],e.query[a]&&(a=e.query[a]),encodeURIComponent(a)+"="+encodeURIComponent(i)}).join("&")},t=function(e,a){var n;return function(){var t=this,r=arguments;clearTimeout(n),n=setTimeout(function(){n=null,e.apply(t,r)},a)}},e.updateResource=t(function(){e.url=e.buildUrl(e.params,e[n.filters]),e[n.resource](e.url).then(function(a){e.setDirectivesValues(a)})},100),e.initDirective=function(){e.params.sortBy=void 0,e.params.sortOrder="asc",e.params.page=1,e.params.count=5,e.updateResource()},n.filters&&e.$watch(n.filters,function(a,n){a!==n&&e.updateResource()},!0),e.$watch("params",function(a,n){a!==n&&e.updateResource()},!0),e.initDirective()}}}]).directive("tastyThead",function(){return{restrict:"AE",require:"^tastyTable",scope:{},templateUrl:"template/table/tasty-head.html",link:function(e,a,n,t){"use strict";var r,i,o;t.$scope.thead=!0,t.$scope.params.thead=!0,e.fields={},o=!0,r=function(e){return e.replace(/[^a-zA-Z0-9-]+/g,"-").toLowerCase()},i=function(){var a,n;for(a=e.header.columns.length,n=0;a>n;n++)e.fields[e.header.columns[n].key]={width:100/a,sort:r(e.header.columns[n].key)};"dsc"===e.header.sortOrder&&(e.header.sortBy="-"+e.header.sortBy)},e.sortBy=function(a){var n;n=r(a.key),e.header.sortBy==n?(e.header.sortBy="-"+n,t.$scope.params.sortOrder="dsc"):(e.header.sortBy=n,t.$scope.params.sortOrder="asc"),t.$scope.params.sortBy=a.key},e.isSortUp=function(a){return void 0===e.fields[a.key]?!1:e.header.sortBy=="-"+e.fields[a.key].sort},e.isSortDown=function(a){return void 0===e.fields[a.key]?!1:e.header.sortBy==e.fields[a.key].sort},t.$scope.$watch("header",function(a,n){a&&a!==n&&(e.header=t.$scope.header,i())})}}}).directive("tastyPagination",function(){return{restrict:"AE",require:"^tastyTable",scope:{},templateUrl:"template/table/tasty-pagination.html",link:function(e,a,n,t){"use strict";var r,i,o,s,p,g,u,c;t.$scope.pagination=!0,t.$scope.params.pagination=!0,e.numPaginations=5,e.pagListCount=[5,25,50,100],e.pagination={},e.pagMinRange=1,e.pagMaxRange=1,u=!0,c=function(e,a){var n;n=[],e=parseInt(e,10),a=parseInt(a,10);for(var t=e;a>t;t++)n.push(t);return n},r=function(e){t.$scope.params.page=e},i=function(a){var n;n=a*e.pagination.page,n>e.pagination.size&&(t.$scope.params.page=Math.ceil(e.pagination.size/a)),t.$scope.params.count=a},o=function(){var a;a=e.pagination.page,a>e.pagination.pages&&(a=e.pagination.pages),e.pagMinRange=a-2>0?a-2:1,e.pagMaxRange=a+2,e.pagination.page=a,g()},s=function(){return e.pagHideMinRange===!0||e.pagMinRange<1?!1:(e.pagMaxRange=e.pagMinRange,e.pagMinRange=e.pagMaxRange-e.numPaginations,void g())},p=function(){return e.pagHideMaxRange===!0||e.pagMaxRange>e.pagination.pages?!1:(e.pagMinRange=e.pagMaxRange,e.pagMaxRange=e.pagMinRange+e.numPaginations,e.pagMaxRange>e.pagination.pages&&(e.pagMaxRange=e.pagination.pages),e.pagMinRange=e.pagMaxRange-e.numPaginations,void g())},g=function(){e.pagMinRange=e.pagMinRange>0?e.pagMinRange:1,e.pagMaxRange=e.pagMinRange+e.numPaginations,e.pagMaxRange>e.pagination.pages&&(e.pagMaxRange=e.pagination.pages+1),e.pagHideMinRange=e.pagMinRange<=1,e.pagHideMaxRange=e.pagMaxRange>=e.pagination.pages,e.pagListCount=e.pagination.size<50?[5,25]:e.pagination.size<100?[5,25,50]:[5,25,50,100],e.rangePage=c(e.pagMinRange,e.pagMaxRange)},e.page={get:r,setCount:i,previous:s,remaining:p},t.$scope.$watch("resourcePagination",function(a,n){a&&a!==n&&(e.pagination={count:a.count,page:a.page,pages:a.pages,size:a.size},o())})}}});
\ No newline at end of file
+angular.module("ngTasty",["ngTasty.table"]),angular.module("ngTasty.table",[]).directive("tastyTable",["$timeout",function(){return{restrict:"A",scope:!0,controller:function(e){this.$scope=e},link:function(e,a,n){"use strict";var t;if(!n.resource)throw"AngularJS tastyTable directive: miss the resource attribute";if(!e[n.resource])throw"AngularJS tastyTable directive: the resource ("+n.resource+") callback it's undefined";e.query={page:"page",count:"count",sortBy:"sort-by",sortOrder:"sort-order"},e.header={columns:[]},e.rows=[],e.params={},e.thead=!1,e.pagination=!1,e.resourcePagination={},e.url="",e.setDirectivesValues=function(a){return a?(e.rows=a.rows,e.header={columns:a.header,sortBy:a.sortBy,sortOrder:a.sortOrder},void(e.resourcePagination=a.pagination)):!1},e.setProperty=function(e,a,n){return a[n]&&(e[n]=a[n]),e},e.joinObjects=function(a,n){for(var t in n)e.setProperty(a,n,t);return a},e.buildUrl=function(a,t){var r,i;return r={},e.thead&&(r=e.setProperty(r,a,"sortBy"),r=e.setProperty(r,a,"sortOrder")),e.pagination&&(r=e.setProperty(r,a,"page"),r=e.setProperty(r,a,"count")),n.filters&&(r=e.joinObjects(r,t)),Object.keys(r).map(function(a){return i=r[a],e.query[a]&&(a=e.query[a]),encodeURIComponent(a)+"="+encodeURIComponent(i)}).join("&")},t=function(e,a){var n;return function(){var t=this,r=arguments;clearTimeout(n),n=setTimeout(function(){n=null,e.apply(t,r)},a)}},e.updateResource=t(function(){e.url=e.buildUrl(e.params,e[n.filters]),e[n.resource](e.url).then(function(a){e.setDirectivesValues(a)})},100),e.initDirective=function(){e.params.sortBy=void 0,e.params.sortOrder="asc",e.params.page=1,e.params.count=5,e.updateResource()},n.filters&&e.$watch(n.filters,function(a,n){a!==n&&e.updateResource()},!0),e.$watch("params",function(a,n){a!==n&&e.updateResource()},!0),e.initDirective()}}}]).directive("tastyThead",function(){return{restrict:"AE",require:"^tastyTable",scope:{},templateUrl:"template/table/head.html",link:function(e,a,n,t){"use strict";var r,i,o;t.$scope.thead=!0,t.$scope.params.thead=!0,e.fields={},o=!0,r=function(e){return e.replace(/[^a-zA-Z0-9-]+/g,"-").toLowerCase()},i=function(){var a,n;for(a=e.header.columns.length,n=0;a>n;n++)e.fields[e.header.columns[n].key]={width:100/a,sort:r(e.header.columns[n].key)};"dsc"===e.header.sortOrder&&(e.header.sortBy="-"+e.header.sortBy)},e.sortBy=function(a){var n;n=r(a.key),e.header.sortBy==n?(e.header.sortBy="-"+n,t.$scope.params.sortOrder="dsc"):(e.header.sortBy=n,t.$scope.params.sortOrder="asc"),t.$scope.params.sortBy=a.key},e.isSortUp=function(a){return void 0===e.fields[a.key]?!1:e.header.sortBy=="-"+e.fields[a.key].sort},e.isSortDown=function(a){return void 0===e.fields[a.key]?!1:e.header.sortBy==e.fields[a.key].sort},t.$scope.$watch("header",function(a,n){a&&a!==n&&(e.header=t.$scope.header,i())})}}}).directive("tastyPagination",function(){return{restrict:"AE",require:"^tastyTable",scope:{},templateUrl:"template/table/pagination.html",link:function(e,a,n,t){"use strict";var r,i,o,s,p,g,u,c;t.$scope.pagination=!0,t.$scope.params.pagination=!0,e.numPaginations=5,e.pagListCount=[5,25,50,100],e.pagination={},e.pagMinRange=1,e.pagMaxRange=1,u=!0,c=function(e,a){var n;n=[],e=parseInt(e,10),a=parseInt(a,10);for(var t=e;a>t;t++)n.push(t);return n},r=function(e){t.$scope.params.page=e},i=function(a){var n;n=a*e.pagination.page,n>e.pagination.size&&(t.$scope.params.page=Math.ceil(e.pagination.size/a)),t.$scope.params.count=a},o=function(){var a;a=e.pagination.page,a>e.pagination.pages&&(a=e.pagination.pages),e.pagMinRange=a-2>0?a-2:1,e.pagMaxRange=a+2,e.pagination.page=a,g()},s=function(){return e.pagHideMinRange===!0||e.pagMinRange<1?!1:(e.pagMaxRange=e.pagMinRange,e.pagMinRange=e.pagMaxRange-e.numPaginations,void g())},p=function(){return e.pagHideMaxRange===!0||e.pagMaxRange>e.pagination.pages?!1:(e.pagMinRange=e.pagMaxRange,e.pagMaxRange=e.pagMinRange+e.numPaginations,e.pagMaxRange>e.pagination.pages&&(e.pagMaxRange=e.pagination.pages),e.pagMinRange=e.pagMaxRange-e.numPaginations,void g())},g=function(){e.pagMinRange=e.pagMinRange>0?e.pagMinRange:1,e.pagMaxRange=e.pagMinRange+e.numPaginations,e.pagMaxRange>e.pagination.pages&&(e.pagMaxRange=e.pagination.pages+1),e.pagHideMinRange=e.pagMinRange<=1,e.pagHideMaxRange=e.pagMaxRange>=e.pagination.pages,e.pagListCount=e.pagination.size<50?[5,25]:e.pagination.size<100?[5,25,50]:[5,25,50,100],e.rangePage=c(e.pagMinRange,e.pagMaxRange)},e.page={get:r,setCount:i,previous:s,remaining:p},t.$scope.$watch("resourcePagination",function(a,n){a&&a!==n&&(e.pagination={count:a.count,page:a.page,pages:a.pages,size:a.size},o())})}}});
\ No newline at end of file
diff --git a/template/table/head.html b/template/table/head.html
new file mode 100644
index 0000000..89110a3
--- /dev/null
+++ b/template/table/head.html
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/template/table/pagination.html b/template/table/pagination.html
new file mode 100644
index 0000000..f8fa727
--- /dev/null
+++ b/template/table/pagination.html
@@ -0,0 +1,31 @@
+