From b0ed620a7c26e06b1eca30c6fb0b097d7d3cf243 Mon Sep 17 00:00:00 2001 From: Fernando Arias Date: Tue, 29 Dec 2015 14:00:40 -0600 Subject: [PATCH] Bump dependencies to latest possible. * Node Sass pinned because of issue with importing css or scss * Jasmine pinned because we need to update tests for newer version --- Gruntfile.coffee | 4 +++- assets/images/pagination_new.png | Bin assets/images/pagination_new_2x.png | Bin dist/marionette.carpenter.css | 34 ++++++++++++++++------------ dist/marionette.carpenter.js | 30 ++++++++++++++---------- dist/marionette.carpenter.min.js | 4 ++-- package.json | 15 ++++++------ 7 files changed, 50 insertions(+), 37 deletions(-) mode change 100644 => 100755 assets/images/pagination_new.png mode change 100644 => 100755 assets/images/pagination_new_2x.png diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 18b3b01..01818bf 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -96,7 +96,6 @@ module.exports = (grunt) -> uglify: options: mangle: true - screwIE8: true # always dist: files: "dist/marionette.carpenter.min.js": "dist/marionette.carpenter.js" @@ -140,6 +139,9 @@ module.exports = (grunt) -> ] sourceMap: false style: 'compact' + functions: + 'image-url($img)': (img) -> + new require('node-sass').types.String('url("/' + img.getValue() + '")') build: expand: true flatten: true diff --git a/assets/images/pagination_new.png b/assets/images/pagination_new.png old mode 100644 new mode 100755 diff --git a/assets/images/pagination_new_2x.png b/assets/images/pagination_new_2x.png old mode 100644 new mode 100755 diff --git a/dist/marionette.carpenter.css b/dist/marionette.carpenter.css index e8d3668..c36746f 100644 --- a/dist/marionette.carpenter.css +++ b/dist/marionette.carpenter.css @@ -82,12 +82,14 @@ .table-component .buttons-region ul li a.action-button.tag:after { background-color: #90da2c; content: '+'; } + .table-component .buttons-region ul li a.action-button.tag:hover { text-decoration: none; background-color: inherit; color: #666; } .table-component .buttons-region ul li a.action-button.tag:hover:after { background-color: #83c923; } + .table-component .buttons-region ul li a.action-button.tag:active { background-color: inherit; color: #333; } @@ -151,11 +153,11 @@ padding-top: 250px; width: 100%; } .table-component .table-region thead { - background-image: -owg(linear-gradient(#fff, #dfdfdf)); - background-image: -webkit(linear-gradient(#fff, #dfdfdf)); - background-image: -moz(linear-gradient(#fff, #dfdfdf)); - background-image: -o(linear-gradient(#fff, #dfdfdf)); - background-image: linear-gradient(#fff, #dfdfdf); } + background-image: -owg(compact(linear-gradient(#fff, #dfdfdf), false, false, false, false, false, false, false, false, false)); + background-image: -webkit(compact(linear-gradient(#fff, #dfdfdf), false, false, false, false, false, false, false, false, false)); + background-image: -moz(compact(linear-gradient(#fff, #dfdfdf), false, false, false, false, false, false, false, false, false)); + background-image: -o(compact(linear-gradient(#fff, #dfdfdf), false, false, false, false, false, false, false, false, false)); + background-image: compact(linear-gradient(#fff, #dfdfdf), false, false, false, false, false, false, false, false, false); } .table-component .table-region thead th { cursor: normal; -webkit-user-select: none; @@ -207,11 +209,11 @@ .table-component .table-region thead th.sortable { cursor: pointer; } .table-component .table-region thead th.sortable:hover, .table-component .table-region thead th.sortable.sort { - background-image: -owg(linear-gradient(#f2f2f2, #d2d2d2)); - background-image: -webkit(linear-gradient(#f2f2f2, #d2d2d2)); - background-image: -moz(linear-gradient(#f2f2f2, #d2d2d2)); - background-image: -o(linear-gradient(#f2f2f2, #d2d2d2)); - background-image: linear-gradient(#f2f2f2, #d2d2d2); } + background-image: -owg(compact(linear-gradient(#f2f2f2, #d2d2d2), false, false, false, false, false, false, false, false, false)); + background-image: -webkit(compact(linear-gradient(#f2f2f2, #d2d2d2), false, false, false, false, false, false, false, false, false)); + background-image: -moz(compact(linear-gradient(#f2f2f2, #d2d2d2), false, false, false, false, false, false, false, false, false)); + background-image: -o(compact(linear-gradient(#f2f2f2, #d2d2d2), false, false, false, false, false, false, false, false, false)); + background-image: compact(linear-gradient(#f2f2f2, #d2d2d2), false, false, false, false, false, false, false, false, false); } .table-component .table-region thead th.disabled { pointer-events: none; background-image: none; @@ -237,9 +239,9 @@ line-height: 23px; vertical-align: baseline; } .table-component .pagination-region .paginator label.row_select select { - -webkit-box-shadow: inset 0, 0, 2px, rgba(0, 0, 0, 0.2); - -moz-box-shadow: inset 0, 0, 2px, rgba(0, 0, 0, 0.2); - box-shadow: inset 0, 0, 2px, rgba(0, 0, 0, 0.2); + -webkit-box-shadow: compact(inset 0, 0, 2px, rgba(0, 0, 0, 0.2), false, false, false, false, false, false); + -moz-box-shadow: compact(inset 0, 0, 2px, rgba(0, 0, 0, 0.2), false, false, false, false, false, false); + box-shadow: compact(inset 0, 0, 2px, rgba(0, 0, 0, 0.2), false, false, false, false, false, false); -webkit-border-radius: 2px; -moz-border-radius: 2px; -ms-border-radius: 2px; @@ -288,7 +290,7 @@ cursor: pointer; } .table-component .pagination-region .paginator .page_navigation a, .table-component .pagination-region .paginator .page_navigation a:hover { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAKCAYAAAAjBNk8AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo5OEQ2RDdCMjE5ODMxMUUzODMwMkVBOTQ1MURCQkI3NiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo5OEQ2RDdCMzE5ODMxMUUzODMwMkVBOTQ1MURCQkI3NiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjk4RDZEN0IwMTk4MzExRTM4MzAyRUE5NDUxREJCQjc2IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjk4RDZEN0IxMTk4MzExRTM4MzAyRUE5NDUxREJCQjc2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Hz0KXgAAAaxJREFUeNq0lTGugkAURR8uhgW4BEtCY6XGgkIbGxIbExsTbaxcgb3roKIjNNhYsQB6QI3z/zWZyWgQZoC5yYuBCec8J8ODGGP0XZfLhQ2HQ1HT6ZRlWUZFUYiqeq4N53w+v9fwq8LkJT8n88CHR/aiDxVmG86AKjIej63VaiWub7cbrddrlue5eFAlfXGawlnggg8PD/zowxRn8As0n88tz/PEvev1SpvNRvx51Yb64Kh4wAMXfB544dfpV5dTuYGv1+tdi8XCmkwm4n4URbTb7VhZlkoN9cVpCjjggcsDH7y8B1OcQd1RRv0fXct1XbEWhiEdDgem80p05TQFHPB44IFP9pvi1J5AFAZqmqYf67Zta53ArpymfHPggU/2m+LUnsD7/U7b7ZYlSSLWZrMZSmsod+U0BRzweOCBD16dE9iG83MDH48H7fd7Fsex/FWl5XKpNZT74Kh4wAOXBz544dfpV5dTuYHP55OOx+PHPHAc5z0PdF6JvjiqowJc8OU5Cz/6MMWp3MDT6cSCIBDXo9GIfN+35NdSJX1xVEcFAj48PPCjD1OcPwEGADyKAmTPW4BiAAAAAElFTkSuQmCC); } - @media (min--moz-device-pixel-ratio: 1.3), (-o-min-device-pixel-ratio: 2.6/2), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx) { + @media (min--moz-device-pixel-ratio: 1.3), (-o-min-device-pixel-ratio: 2.6 / 2), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx) { .table-component .pagination-region .paginator .page_navigation a, .table-component .pagination-region .paginator .page_navigation a:hover { /* on retina, use image that's scaled by 2 */ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI4AAAAUCAYAAABbAAUtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjY2MDc4MEFBREVCRjExRTM4MTY1OEE1NDQ5QzYxRjE1IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjY2MDc4MEFCREVCRjExRTM4MTY1OEE1NDQ5QzYxRjE1Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NjYwNzgwQThERUJGMTFFMzgxNjU4QTU0NDlDNjFGMTUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NjYwNzgwQTlERUJGMTFFMzgxNjU4QTU0NDlDNjFGMTUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz52TA0sAAABVUlEQVR42uya4Q2DIBCFSTfoCqzgLK7QFVzBWVyhK7iCK3QFShObGMPRA7kDmnfJ/SzvYT8FjjPOOcNJHw+f7pQvn5Y7Rm7GtA0j9jGOv7UCHu1JgxsjMbdB+rkG5sD2kjrwHBh49XkXnMw3SO2OwRn2P+Y8r7ECNElecgTWwOCLAjikdqfgfIDfAvOZK0CT7KWkyKQADqndITiL5gv4w3uylyufNRfIQRicqHZH4EwB/5vkkh/xneVFXbAAOFHtDsBRe+kkPwASn7inAjikduPgWM1lnuE324v6pqogOKR2w+CQm/sK4Fw65Kgf4wqCE9VuEJxoOUEZmstlFenCkRUGJ6rdEDgsj5WLfEnP5GZk427qRU3t//eCpQpLlfpShc0xNsc4juM4rnMcRwEQBUBcOeDKQf7KAZecuOREWwXaKnTaKtDIhUauZHDQOorW0WO+BRgAtVH6DdOkhwgAAAAASUVORK5CYII=); @@ -424,5 +426,7 @@ z-index: 2; } .table-component table.rc-table-resizing { cursor: ew-resize; } - .table-component table.rc-table-resizing thead, .table-component table.rc-table-resizing thead > th, .table-component table.rc-table-resizing thead > th > a { + .table-component table.rc-table-resizing thead, + .table-component table.rc-table-resizing thead > th, + .table-component table.rc-table-resizing thead > th > a { cursor: ew-resize; } diff --git a/dist/marionette.carpenter.js b/dist/marionette.carpenter.js index 22e555c..e78cf1e 100644 --- a/dist/marionette.carpenter.js +++ b/dist/marionette.carpenter.js @@ -741,6 +741,7 @@ define('templates/action_button',[],function(){ return _safe(result); }; (function() { + _print(_safe('No items were found.')); }).call(this); @@ -1034,6 +1036,7 @@ define('templates/header',[],function(){ return _safe(result); }; (function() { + if (this.title && this.title.length) { _print(_safe('\n \n\n\n')); _print(_safe('\n
\n
\n\n')); @@ -1292,6 +1296,7 @@ define('templates/loading',[],function(){ return _safe(result); }; (function() { + _print(_safe('\n')); }).call(this); @@ -1358,13 +1363,13 @@ define('templates/paginator',[],function(){ return _safe(result); }; (function() { - var i, j, len, ref, val; + var i, val, _i, _len, _ref; if (this.collection.length > 0) { _print(_safe('\n
\n "))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a});var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty,k=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};h("views/action_button",["templates/action_button"],function(a){var b;return b=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return i(c,b),c.prototype.template=a,c.prototype.tagName="li",c.prototype.className=function(){return this.model.get("containerClass")},c.prototype.modelEvents={"change:disabled":"render"},c.prototype.events={click:"executeClickActions"},c.prototype.initialize=function(a){return this.carpenter=a.carpenter,this.selectable=!!a.selectable,this.tableCollection=a.tableCollection,this.tableSelections=a.tableSelections,this.listenTo(this.tableCollection,"selection_toggled",function(a){return function(){return a.setActivationState()}}(this)),this.listenTo(this.tableCollection,"select_all_toggled",function(a){return function(){return a.setActivationState()}}(this))},c.prototype.setActivationState=function(a){var b,c,d,e;return b=this.model.get("activateOn"),this.selectable&&b?(d=this.tableCollection.numSelected,c=this.tableSelections.selectAllState||d>1,e=1===d,"any"===b&&(e||c)?this.model.enable():"many"===b&&c?this.model.enable():"one"===b&&e&&!this.tableSelections.selectAllState?this.model.enable():this.model.disable()):(this.model.enable(),!1)},c.prototype.executeClickActions=function(){return null==this.model.get("disabled")||null!=this.model.get("disabled")&&!this.model.get("disabled")?(this.executeCallback(),this.executeTrigger()):void 0},c.prototype.executeTrigger=function(){return this.model.get("event")?this.carpenterRadio.trigger(this.model.get("event")):void 0},c.prototype.executeCallback=function(){var a,b,c,d;return this.model.get("click")?this.selectable?(b=this.tableSelections.selectAllState,c=Object.keys(this.tableSelections.selectedIDs),a=Object.keys(this.tableSelections.deselectedIDs),d=new Backbone.Collection(this.tableCollection.filter(function(a){var b;return b=a.id,k.call(c,b)>=0})),this.model.get("click")(b,c,a,d,this.tableCollection)):this.model.get("click")():!1},c}(e.ItemView)});var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/control_bar",["views/action_button"],function(a){var b;return b=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return i(c,b),c.prototype.childView=a,c.prototype.tagName="ul",c.prototype.className="table-control-bar",c.prototype.initialize=function(a){return null==a&&(a={}),this.collection=a.actionButtonsCollection,this.columns=a.columns,this.tableSelections=a.tableSelections,this.tableCollection=a.tableCollection,this.selectable=!!a.selectable,this.carpenter=a.carpenter,c.__super__.initialize.apply(this,arguments)},c.prototype.buildChildView=function(a,b,c){var e,f;return e={tableSelections:this.tableSelections,tableCollection:this.tableCollection,selectable:this.selectable,model:a},f=d.extend(e,c),new b(f)},c.prototype.serializeData=function(){return this},c}(e.CollectionView)}),h("templates/empty",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){d(b("No items were found."))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a});var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/empty",["templates/empty"],function(a){var b;return b=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return i(c,b),c.prototype.template=a,c.prototype.tagName="tr",c.prototype.attributes={class:"empty"},c}(e.ItemView)}),h("templates/header",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){this.title&&this.title.length&&(d(b("\n \n ")),d(this.title),d(b("\n \n"))),d(b("\n\n
\n ")),this.searchable&&d(b("\n \n ")),d(b("\n
\n"))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a});var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/header",["templates/header"],function(a){var b;return b=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return i(c,b),c.prototype.template=a,c.prototype.attributes={class:"table-header"},c.prototype.initialize=function(a){return null==a&&(a={}),this.title=a.title,this.taggable=!!a.taggable,this.htmlID=a.htmlID},c.prototype.serializeData=function(){return this},c}(e.ItemView)}),h("templates/layout",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){d(b("\n
\n
\n\n")),d(b("\n
\n
\n\n")),d(b("\n
\n
\n\n
\n
\n\n
\n ")),d(b("\n
\n
\n\n ")),d(b("\n
\n
\n
\n\n")),d(b("\n
\n
\n"))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a});var l=function(a,b){return function(){return a.apply(b,arguments)}},i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/layout",["templates/layout"],function(a){var b;return b=function(b){function e(){return this._modelForTd=l(this._modelForTd,this),this._columnForTd=l(this._columnForTd,this),this.mouseEnteredTableCell=l(this.mouseEnteredTableCell,this),this.mouseEnteredTableHeader=l(this.mouseEnteredTableHeader,this),e.__super__.constructor.apply(this,arguments)}return i(e,b),e.prototype.template=a,e.prototype.regions={headerRegion:".header-region",filterRegion:".filter-region",buttonsRegion:".buttons-region",tableRegion:".table-region",paginationRegion:".pagination-region",overlayRegion:".overlay-region",selectionIndicatorRegion:".selection-indicator-region"},e.prototype.events={"mouseenter td":"mouseEnteredTableCell","mouseenter th":"mouseEnteredTableHeader"},e.prototype.attributes={class:"table-component foundation"},e.prototype.initialize=function(a){return null==a&&(a={}),d.extend(this.regions,null!=a?a.regions:void 0),this.controller=a,this.columns=a.columns,this.collection=a.collection,this.selectable=!!a.selectable},e.prototype.serializeData=function(){return this},e.prototype.mouseEnteredTableHeader=function(a){return this.overlayRegion.reset()},e.prototype.mouseEnteredTableCell=function(a){var b,d,e,f,g;if(b=this._columnForTd(a.currentTarget),e=this._modelForTd(a.currentTarget),null!=(null!=b?b.hoverView:void 0)){if(null!=(null!=b?b.hoverOn:void 0)&&!b.hoverOn.call({model:e,column:b}))return;return d=new b.hoverView({model:e,column:b}),g=c(a.currentTarget).position(),g.top+=c(a.currentTarget).outerHeight()-2,g.width=c(a.currentTarget).outerWidth(),this.overlayRegion.show(d),null!=(f=this.overlayRegion.$el)?f.css(g):void 0}return this.overlayRegion.reset()},e.prototype._columnForTd=function(a){var b;return b=c(a).index(),this.selectable&&b--,this.columns[b]},e.prototype._modelForTd=function(a){var b;return b=c(a).parent("tr").index(),this.collection.models[b]},e}(e.LayoutView)}),h("templates/loading",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){d(b("\n"))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a});var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/loading",["templates/loading"],function(a){var b;return b=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return i(c,b),c.prototype.template=a,c.prototype.tagName="tr",c}(e.ItemView)}),h("templates/paginator",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){var a,c,e,f,g;if(this.collection.length>0){for(d(b("\n
\n \n\n \n Showing ")),d((this.currentPage-1)*this.perPage+1),d(b(" - ")),d(this.lastRow),d(b(" of ")),d(this.totalRecords),d(b("\n \n
\n\n \n"))}d(b("\n"))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a}),Backbone.Paginator=function(a,b,c){"use strict";var d=b.map(a.VERSION.split("."),function(a){return parseInt(a,10)}),e={};e.version="1.0.0-dev",e.clientPager=a.Collection.extend({useDiacriticsPlugin:!0,useLevenshteinPlugin:!0,sortColumn:"",sortDirection:"desc",lastSortColumn:"",fieldFilterRules:[],lastFieldFilterRules:[],filterFields:"",filterExpression:"",lastFilterExpression:"",defaults_ui:{firstPage:0,currentPage:1,perPage:5,totalPages:10,pagesInRange:4},initialize:function(){this.on("add",this.addModel,this),this.on("remove",this.removeModel,this),this.setDefaults()},setDefaults:function(){var a=b.defaults(this.paginator_ui,this.defaults_ui);b.defaults(this,a)},addModel:function(a){this.origModels.push(a)},removeModel:function(a){var c=b.indexOf(this.origModels,a);this.origModels.splice(c,1)},sync:function(e,f,g){var h=this;this.setDefaults();var i={};b.each(b.result(h,"server_api"),function(a,c){b.isFunction(a)&&(a=b.bind(a,h),a=a()),i[c]=a});var j=b.clone(h.paginator_core);b.each(j,function(a,c){b.isFunction(a)&&(a=b.bind(a,h),a=a()),j[c]=a}),j=b.defaults(j,{timeout:25e3,cache:!1,type:"GET",dataType:"jsonp"}),j=b.extend(j,{data:decodeURIComponent(c.param(i)),processData:!1,url:b.result(j,"url")},g);var k=!(0===d[0]&&9===d[1]&&10===d[2]),l=0===d[0],m=j.success;j.success=function(a,b,c){m&&(k?m(a,b,c):m(f,a,j)),l&&f&&f.trigger&&f.trigger("sync",f,a,j)};var n=j.error;j.error=function(a){n&&n(a),l&&f&&f.trigger&&f.trigger("error",f,a,j)};var o=j.xhr=a.ajax(j);return f&&f.trigger&&f.trigger("request",f,o,j),o},nextPage:function(a){this.currentPage1&&(this.currentPage=--this.currentPage,this.pager(a))},goTo:function(a,b){void 0!==a&&(this.currentPage=parseInt(a,10),this.pager(b))},howManyPer:function(a){if(void 0!==a){var b=this.perPage;this.perPage=parseInt(a,10),this.currentPage=Math.ceil((b*(this.currentPage-1)+1)/a),this.pager()}},setSort:function(a,b){void 0!==a&&void 0!==b&&(this.lastSortColumn=this.sortColumn,this.sortColumn=a,this.sortDirection=b,this.pager(),this.info())},setFieldFilter:function(a){b.isEmpty(a)?(this.lastFieldFilterRules=this.fieldFilterRules,this.fieldFilterRules="",this.pager(),this.info()):(this.lastFieldFilterRules=this.fieldFilterRules,this.fieldFilterRules=a,this.pager(),this.info())},doFakeFieldFilter:function(a){if(!b.isEmpty(a)){var c=this.origModels;return void 0===c&&(c=this.models),c=this._fieldFilter(c,a),""!==this.filterExpression&&(c=this._filter(c,this.filterFields,this.filterExpression)),c.length}},setFilter:function(a,b){void 0!==a&&void 0!==b&&(this.filterFields=a,this.lastFilterExpression=this.filterExpression,this.filterExpression=b,this.pager(),this.info())},doFakeFilter:function(a,c){if(void 0!==a&&void 0!==c){var d=this.origModels;return void 0===d&&(d=this.models),b.isEmpty(this.fieldFilterRules)||(d=this._fieldFilter(d,this.fieldFilterRules)),d=this._filter(d,a,c),d.length}},pager:function(a){var c=this,d=this.perPage,e=(c.currentPage-1)*d,f=e+d;void 0===c.origModels&&(c.origModels=c.models),c.models=c.origModels.slice(),""!==this.sortColumn&&(c.models=c._sort(c.models,this.sortColumn,this.sortDirection)),b.isEmpty(this.fieldFilterRules)||(c.models=c._fieldFilter(c.models,this.fieldFilterRules)),""!==this.filterExpression&&(c.models=c._filter(c.models,this.filterFields,this.filterExpression)),this.lastSortColumn===this.sortColumn&&this.lastFilterExpression===this.filterExpression&&b.isEqual(this.fieldFilterRules,this.lastFieldFilterRules)||(e=0,f=e+d,c.currentPage=1,this.lastSortColumn=this.sortColumn,this.lastFieldFilterRules=this.fieldFilterRules,this.lastFilterExpression=this.filterExpression),c.sortedAndFilteredModels=c.models.slice(),c.info(),c.reset(c.models.slice(e,f)),b.result(a,"success")},_sort:function(a,c,d){return a=a.sort(function(a,e){var f=a.get(c),g=e.get(c);if(b.isUndefined(f)||b.isUndefined(g)||null===f||null===g)return 0;if(f=f.toString().toLowerCase(),g=g.toString().toLowerCase(),"desc"===d)if(!f.match(/[^\-\d\.]/)&&f.match(/-?[\d\.]+/)&&!g.match(/[^\-\d\.]/)&&g.match(/-?[\d\.]+/)){if(g-0>f-0)return 1;if(f-0>g-0)return-1}else{if(g>f)return 1;if(f>g)return-1}else if(!f.match(/[^\-\d\.]/)&&f.match(/-?[\d\.]+/)&&!g.match(/[^\-\d\.]/)&&g.match(/-?[\d\.]+/)){if(g-0>f-0)return-1;if(f-0>g-0)return 1}else{if(g>f)return-1;if(f>g)return 1}if(a.cid&&e.cid){var h=a.cid,i=e.cid;if(i>h)return-1;if(h>i)return 1}return 0})},_fieldFilter:function(a,c){if(b.isEmpty(c))return a;var d=[];return b.each(a,function(a){var e=!0;b.each(c,function(c){if(!e)return!1;if(e=!1,"function"===c.type){var d=b.wrap(c.value,function(b){return b(a.get(c.field))});d()&&(e=!0)}else if("required"===c.type)b.isEmpty(a.get(c.field).toString())||(e=!0);else if("min"===c.type)!b.isNaN(Number(a.get(c.field)))&&!b.isNaN(Number(c.value))&&Number(a.get(c.field))>=Number(c.value)&&(e=!0);else if("max"===c.type)!b.isNaN(Number(a.get(c.field)))&&!b.isNaN(Number(c.value))&&Number(a.get(c.field))<=Number(c.value)&&(e=!0);else if("range"===c.type)!b.isNaN(Number(a.get(c.field)))&&b.isObject(c.value)&&!b.isNaN(Number(c.value.min))&&!b.isNaN(Number(c.value.max))&&Number(a.get(c.field))>=Number(c.value.min)&&Number(a.get(c.field))<=Number(c.value.max)&&(e=!0);else if("minLength"===c.type)a.get(c.field).toString().length>=c.value&&(e=!0);else if("maxLength"===c.type)a.get(c.field).toString().length<=c.value&&(e=!0);else if("rangeLength"===c.type)b.isObject(c.value)&&!b.isNaN(Number(c.value.min))&&!b.isNaN(Number(c.value.max))&&a.get(c.field).toString().length>=c.value.min&&a.get(c.field).toString().length<=c.value.max&&(e=!0);else if("oneOf"===c.type)b.isArray(c.value)&&b.include(c.value,a.get(c.field))&&(e=!0);else if("equalTo"===c.type)c.value===a.get(c.field)&&(e=!0);else if("containsAllOf"===c.type)b.isArray(c.value)&&b.isArray(a.get(c.field))&&b.intersection(c.value,a.get(c.field)).length===c.value.length&&(e=!0);else if("pattern"===c.type)a.get(c.field).toString().match(c.value)&&(e=!0);else if("custom"===c.type){var f=a.toJSON(),g=b.wrap(c.value,function(a){return a(f)});g()&&(e=!0)}else e=!1}),e&&d.push(a)}),d},_filter:function(c,d,e){var f=this,g={};if(b.isString(d)?g[d]={cmp_method:"regexp"}:b.isArray(d)?b.each(d,function(a){g[a]={cmp_method:"regexp"}}):b.each(d,function(a,c){g[c]=b.defaults(a,{cmp_method:"regexp"})}),d=g,b.has(a.Paginator,"removeDiacritics")&&f.useDiacriticsPlugin&&(e=a.Paginator.removeDiacritics(e)),""===e||!b.isString(e))return c;var h=b.map(e.match(/\w+/gi),function(a){return a.toLowerCase()}),i="("+b.uniq(h).join("|")+")",j=new RegExp(i,"igm"),k=[];return b.each(c,function(c){var g=[];b.each(d,function(d,i){var k=c.get(i);if(k){var l=[];if(k=b.has(a.Paginator,"removeDiacritics")&&f.useDiacriticsPlugin?a.Paginator.removeDiacritics(k.toString()):k.toString(),"levenshtein"===d.cmp_method&&b.has(a.Paginator,"levenshtein")&&f.useLevenshteinPlugin){var m=a.Paginator.levenshtein(k,e);b.defaults(d,{max_distance:0}),m<=d.max_distance&&(l=b.uniq(h))}else l=k.match(j);l=b.map(l,function(a){return a.toString().toLowerCase()}),b.each(l,function(a){g.push(a)})}}),g=b.uniq(b.without(g,"")),b.isEmpty(b.difference(h,g))&&k.push(c)}),k},info:function(){var a=this,b={},c=a.sortedAndFilteredModels?a.sortedAndFilteredModels.length:a.length,d=Math.ceil(c/a.perPage);return b={totalUnfilteredRecords:a.origModels.length,totalRecords:c,currentPage:a.currentPage,perPage:this.perPage,totalPages:d,lastPage:d,previous:!1,next:!1,startRecord:0===c?0:(a.currentPage-1)*this.perPage+1,endRecord:Math.min(c,a.currentPage*this.perPage)},a.currentPage>1&&(b.previous=a.currentPage-1),a.currentPage1)if(1+e>=f)for(c=1,d=f;d>=c;c++)b.push(c);else if(a.currentPage<=this.pagesInRange+1)for(c=1,d=2+e;d>c;c++)b.push(c);else if(f-this.pagesInRange>a.currentPage&&a.currentPage>this.pagesInRange)for(c=a.currentPage-this.pagesInRange;c<=a.currentPage+this.pagesInRange;c++)b.push(c);else for(c=f-e;f>=c;c++)b.push(c);return b},bootstrap:function(a){return b.extend(this,a),this.goTo(1),this.info(),this}}),e.clientPager.prototype.prevPage=e.clientPager.prototype.previousPage;var f=function(){var a=new c.Deferred;return a.reject(),a.promise()};return e.requestPager=a.Collection.extend({sync:function(e,f,g){var h=this;h.setDefaults();var i={};b.each(b.result(h,"server_api"),function(a,c){b.isFunction(a)&&(a=b.bind(a,h),a=a()),i[c]=a});var j=b.clone(h.paginator_core);b.each(j,function(a,c){b.isFunction(a)&&(a=b.bind(a,h),a=a()),j[c]=a}),j=b.defaults(j,{timeout:25e3,cache:!1,type:"GET",dataType:"jsonp",url:h.url}),g.data?g.data=decodeURIComponent(c.param(b.extend(i,g.data))):g.data=decodeURIComponent(c.param(i)),j=b.extend(j,{data:decodeURIComponent(c.param(i)),processData:!1,url:b.result(j,"url")},g);var k=!(0===d[0]&&9===d[1]&&10===d[2]),l=0===d[0],m=j.success;j.success=function(a,b,c){m&&(k?m(a,b,c):m(f,a,j)),l&&f&&f.trigger&&f.trigger("sync",f,a,j)};var n=j.error;j.error=function(a){n&&n(a),l&&f&&f.trigger&&f.trigger("error",f,a,j)};var o=j.xhr=a.ajax(j);return f&&f.trigger&&f.trigger("request",f,o,j),o},setDefaults:function(){var a=this;b.defaults(a.paginator_ui,{firstPage:0,currentPage:1,perPage:5,totalPages:10,pagesInRange:4}),b.each(a.paginator_ui,function(c,d){b.isUndefined(a[d])&&(a[d]=a.paginator_ui[d])})},requestNextPage:function(a){return void 0!==this.currentPage?(this.currentPage+=1,this.pager(a)):f()},requestPreviousPage:function(a){return void 0!==this.currentPage?(this.currentPage-=1,this.pager(a)):f()},updateOrder:function(a,b){return void 0!==a?(this.sortField=a,this.pager(b)):f()},goTo:function(a,b){return void 0!==a?(this.currentPage=parseInt(a,10),this.pager(b)):f()},howManyPer:function(a,b){return void 0!==a?(this.currentPage=this.firstPage,this.perPage=a,this.pager(b)):f()},info:function(){var a={totalRecords:this.totalRecords||0,currentPage:this.currentPage,firstPage:this.firstPage,totalPages:Math.ceil(this.totalRecords/this.perPage),lastPage:this.totalPages,perPage:this.perPage,previous:!1,next:!1};return this.currentPage>1&&(a.previous=this.currentPage-1),this.currentPage1)if(1+e>=f)for(c=1,d=f;d>=c;c++)b.push(c);else if(a.currentPage<=this.pagesInRange+1)for(c=1,d=2+e;d>c;c++)b.push(c);else if(f-this.pagesInRange>a.currentPage&&a.currentPage>this.pagesInRange)for(c=a.currentPage-this.pagesInRange;c<=a.currentPage+this.pagesInRange;c++)b.push(c);else for(c=f-e;f>=c;c++)b.push(c);return b},pager:function(a){return b.isObject(a)||(a={}),this.fetch(a)},url:function(){return void 0!==this.paginator_core&&void 0!==this.paginator_core.url?this.paginator_core.url:null},bootstrap:function(a){return b.extend(this,a),this.setDefaults(),this.info(),this}}),e.requestPager.prototype.nextPage=e.requestPager.prototype.requestNextPage,e.requestPager.prototype.prevPage=e.requestPager.prototype.requestPreviousPage,e}(Backbone,d,jQuery),h("views/../../bower_components/backbone.paginator/dist/backbone.paginator.js",function(){}); -var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/paginator",["templates/paginator","../../bower_components/backbone.paginator/dist/backbone.paginator.js"],function(a){var b;return b=function(b){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,b),e.ALL_MAGIC="99999999",e.prototype.template=a,e.prototype.attributes={class:"paginator"},e.prototype.ui={next:".page_navigation a.next",previous:".page_navigation a.previous",last:".page_navigation a.last",first:".page_navigation a.first",pageInput:".page_navigation input",perPage:".row_select select"},e.prototype.triggers={"click @ui.first":"table:first","click @ui.last":"table:last","click @ui.next":"table:next","click @ui.previous":"table:previous","change @ui.perPage":"table:setPerPage","change @ui.pageInput":"table:pageInputChanged","keyup @ui.pageInput":"table:pageInputChanged"},e.prototype.events={"click @ui.pageInput":"pageInputClicked"},e.prototype.perPage=20,e.prototype.perPageOptions=[20,50,100,"All"],e.prototype.initialize=function(a){return null==a&&(a={}),this.collection=a.collection,this.perPageOptions=a.perPageOptions||this.perPageOptions,this.perPage=a.perPage||this.perPage,this.static=!!a.static,d.contains(this.perPageOptions,this.perPage)||this.perPageOptions.unshift(this.perPage),this.static?this.collection.howManyPer(this.perPage):this.collection.perPage=this.perPage,this.listenTo(this.collection,"sync",this.render),this.listenTo(this.collection,"reset",this.render)},e.prototype.pageInputClicked=function(a){return c(a.currentTarget).select()},e.prototype.serializeData=function(){var a,b,c,f;return f=this.collection.totalRecords||(null!=(b=this.collection)&&null!=(c=b.origModels)?c.length:void 0)||0,a=Math.min(this.collection.currentPage*this.collection.perPage,f),d.extend({},this,this.collection,{totalRecords:f,lastRow:a,isLastPage:a===f,isFirstPage:1===this.collection.currentPage,ALL_MAGIC:e.ALL_MAGIC})},e}(e.ItemView)}),h("templates/row",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){var a,c,e,f,g;for(this.selectable&&(d(b('\n \n \n \n"))),d(b("\n\n")),e=0,d(b("\n")),g=this.columns,c=0,f=g.length;f>c;c++)a=g[c],d(b("\n \n ")),null!=a.view?d(b("\n\n ")):null!=a.render?(d(b("\n ")),d(a.render.call(this)),d(b("\n "))):(d(b("\n ")),a.escape?(d(b("\n ")),d(this.model.get(a.attribute)),d(b("\n "))):(d(b("\n ")),d(b(this.model.get(a.attribute))),d(b("\n "))),d(b("\n "))),d(b("\n \n\n ")),e++,d(b("\n"));d(b("\n"))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a}),h("utilities/string_utils",[],function(){var a;return a={underscored:function(a){return a=null===a?"":String(a),a.trim().replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},capitalize:function(a){return a=null===a?"":String(a),a.charAt(0).toUpperCase()+a.slice(1)},humanize:function(b){return a.capitalize(a.underscored(b).replace(/_id$/,"").replace(/_/g," "))}}});var l=function(a,b){return function(){return a.apply(b,arguments)}},i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/row",["templates/row","utilities/string_utils"],function(a,b){var c;return c=function(c){function e(){return this.onShow=l(this.onShow,this),this.selectionStateChanged=l(this.selectionStateChanged,this),e.__super__.constructor.apply(this,arguments)}return i(e,c),e.prototype.template=a,e.prototype.tagName="tr",e.prototype.ui={checkbox:"td.checkbox input"},e.prototype.events={"change @ui.checkbox":"triggerSelectionEvents"},e.prototype.modelEvents={"change:selected":"selectionStateChanged"},e.prototype.initialize=function(a){return null==a&&(a={}),this.columns=a.columns,this.selectable=!!a.selectable,this.tableSelections=a.tableSelections,this.serverAPI=a.serverAPI,this.controller=a.controller,this.setInitialSelectionState(),d.each(this.columns,function(a){return function(b,c){return null!=b.view?a.addRegion(a.regionName(c),"td."+a.regionName(c)):void 0}}(this))},e.prototype.selectionStateChanged=function(){return!!this.ui.checkbox.prop("checked")!==this.model.get("selected")?(this.ui.checkbox.prop("checked",this.model.get("selected")),this.recordSelectionState()):void 0},e.prototype.setInitialSelectionState=function(){return this.selectable?this.tableSelections.selectAllState?this.model.set("selected",!(this.model.id in this.tableSelections.deselectedIDs),{silent:!0}):this.model.set("selected",this.model.id in this.tableSelections.selectedIDs,{silent:!0}):!1},e.prototype.setSelectionState=function(){return this.ui.checkbox.prop("checked")?this.model.set("selected",!0):this.model.set("selected",!1)},e.prototype.recordSelectionState=function(){return this.selectable?this.tableSelections.selectAllState?this.ui.checkbox.prop("checked")?delete this.tableSelections.deselectedIDs[this.model.id]:this.tableSelections.deselectedIDs[this.model.id]=!0:this.ui.checkbox.prop("checked")?this.tableSelections.selectedIDs[this.model.id]=!0:delete this.tableSelections.selectedIDs[this.model.id]:void 0},e.prototype.triggerSelectionEvents=function(){return this.setSelectionState(),this.recordSelectionState(),this.controller.carpenterRadio.trigger("table:row:selection_toggled",this.model),this.model.trigger("selection_toggled"),this.ui.checkbox.prop("checked")?(this.controller.carpenterRadio.trigger("table:row:selected",this.model),this.model.trigger("selected")):(this.controller.carpenterRadio.trigger("table:row:deselected",this.model),this.model.trigger("deselected"))},e.prototype.onShow=function(){return d.each(this.columns,function(a){return function(b,c){var e,f,g,h;if(null!=b.view){if(h=d.extend({},b.viewOpts),d.extend(h,{model:a.model,column:b,collection:a.model.collection,serverAPI:a.serverAPI}),g=new b.view(h),e=g.getMainView?g:null,g=g.getMainView?g.getMainView():g,!g)throw new Error("getMainView() did not return a view instance or "+(null!=g&&null!=(f=g.constructor)?f.name:void 0)+" is not a view instance");return null!=e&&a.listenTo(g,"destroy",e.destroy),a[a.regionName(c)].show(g)}}}(this))},e.prototype.regionName=function(a){return"cell"+a},e.prototype.serializeData=function(){return d.extend({StringUtils:b},this)},e}(e.LayoutView)}),h("templates/table",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){var a,c,e,f,g;for(d(b("\n \n \n ")),this.selectable&&d(b('\n \n ')),d(b("\n\n ")),f=this.columns,c=0,e=f.length;e>c;c++)a=f[c],d(b("\n ")),g=a.attribute===this.sortColumn,d(b('\n \n "));d(b("\n \n \n\n \n\n \n
\n \n \n \n ')),a.escapeLabel?(d(b("\n ")),d(a.label),d(b("\n "))):(d(b("\n ")),d(b(a.label)),d(b("\n "))),d(b("\n \n
\n"))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a});var m=function(a,b){return function(){return a.apply(b,arguments)}},n=[].slice;!function(a,b){var c,d,e,f;return d=function(a){return parseFloat(a.style.width.replace("%",""))},f=function(a,b){return b=b.toFixed(2),a.style.width=""+b+"%"},e=function(a){return 0===a.type.indexOf("touch")?(a.originalEvent.touches[0]||a.originalEvent.changedTouches[0]).pageX:a.pageX},c=function(){function c(c,d){this.pointerdown=m(this.pointerdown,this),this.constrainWidth=m(this.constrainWidth,this),this.options=a.extend({},this.defaults,d),this.$table=c,this.setHeaders(),this.restoreColumnWidths(),this.syncHandleWidths(),a(b).on("resize.rc",function(a){return function(){return a.syncHandleWidths()}}(this)),this.options.start&&this.$table.bind("column:resize:start.rc",this.options.start),this.options.resize&&this.$table.bind("column:resize.rc",this.options.resize),this.options.stop&&this.$table.bind("column:resize:stop.rc",this.options.stop)}return c.prototype.defaults={selector:"tr th:visible",store:b.store,syncHandlers:!0,resizeFromBody:!0,maxWidth:null,minWidth:null},c.prototype.triggerEvent=function(b,c,d){var e;return e=a.Event(b),e.originalEvent=a.extend({},d),this.$table.trigger(e,[this].concat(c||[]))},c.prototype.getColumnId=function(a){return this.$table.data("resizable-columns-id")+"-"+a.data("resizable-column-id")},c.prototype.setHeaders=function(){return this.$tableHeaders=this.$table.find(this.options.selector),this.assignPercentageWidths(),this.createHandles()},c.prototype.destroy=function(){return this.$handleContainer.remove(),this.$table.removeData("resizableColumns"),this.$table.add(b).off(".rc")},c.prototype.assignPercentageWidths=function(){return this.$tableHeaders.each(function(b){return function(c,d){var e;return e=a(d),f(e[0],e.outerWidth()/b.$table.width()*100)}}(this))},c.prototype.createHandles=function(){var b;return null!=(b=this.$handleContainer)&&b.remove(),this.$table.before(this.$handleContainer=a("
")),this.$tableHeaders.each(function(b){return function(c,d){var e;if(0!==b.$tableHeaders.eq(c+1).length&&null==b.$tableHeaders.eq(c).attr("data-noresize")&&null==b.$tableHeaders.eq(c+1).attr("data-noresize"))return e=a("
"),e.data("th",a(d)),e.appendTo(b.$handleContainer)}}(this)),this.$handleContainer.on("mousedown touchstart",".rc-handle",this.pointerdown)},c.prototype.syncHandleWidths=function(){return this.$handleContainer.width(this.$table.width()).find(".rc-handle").each(function(b){return function(c,d){var e;return e=a(d),e.css({left:e.data("th").outerWidth()+(e.data("th").offset().left-b.$handleContainer.offset().left),height:b.options.resizeFromBody?b.$table.height():b.$table.find("thead").height()})}}(this))},c.prototype.saveColumnWidths=function(){return this.$tableHeaders.each(function(b){return function(c,e){var f;return f=a(e),null==f.attr("data-noresize")&&null!=b.options.store?b.options.store.set(b.getColumnId(f),d(f[0])):void 0}}(this))},c.prototype.restoreColumnWidths=function(){return this.$tableHeaders.each(function(b){return function(c,d){var e,g;return e=a(d),null!=b.options.store&&(g=b.options.store.get(b.getColumnId(e)))?f(e[0],g):void 0}}(this))},c.prototype.totalColumnWidths=function(){var b;return b=0,this.$tableHeaders.each(function(c){return function(c,d){return b+=parseFloat(a(d)[0].style.width.replace("%",""))}}(this)),b},c.prototype.constrainWidth=function(a){return null!=this.options.minWidth&&(a=Math.max(this.options.minWidth,a)),null!=this.options.maxWidth&&(a=Math.min(this.options.maxWidth,a)),a},c.prototype.pointerdown=function(b){var c,g,h,i,j,k,l;return b.preventDefault(),h=a(b.currentTarget.ownerDocument),k=e(b),c=a(b.currentTarget),g=c.data("th"),i=this.$tableHeaders.eq(this.$tableHeaders.index(g)+1),l={left:d(g[0]),right:d(i[0])},j={left:l.left,right:l.right},this.$handleContainer.add(this.$table).addClass("rc-table-resizing"),g.add(i).add(c).addClass("rc-column-resizing"),this.triggerEvent("column:resize:start",[g,i,j.left,j.right],b),h.on("mousemove.rc touchmove.rc",function(a){return function(b){var c;return c=(e(b)-k)/a.$table.width()*100,f(g[0],j.left=a.constrainWidth(l.left+c)),f(i[0],j.right=a.constrainWidth(l.right-c)),null!=a.options.syncHandlers&&a.syncHandleWidths(),a.triggerEvent("column:resize",[g,i,j.left,j.right],b)}}(this)),h.one("mouseup touchend",function(a){return function(){return h.off("mousemove.rc touchmove.rc"),a.$handleContainer.add(a.$table).removeClass("rc-table-resizing"),g.add(i).add(c).removeClass("rc-column-resizing"),a.syncHandleWidths(),a.saveColumnWidths(),a.triggerEvent("column:resize:stop",[g,i,j.left,j.right],b)}}(this))},c}(),a.fn.extend({resizableColumns:function(){var b,d;return d=arguments[0],b=2<=arguments.length?n.call(arguments,1):[],this.each(function(){var e,f;return e=a(this),f=e.data("resizableColumns"),f||e.data("resizableColumns",f=new c(e,d)),"string"==typeof d?f[d].apply(f,b):void 0})}})}(window.jQuery,window),h("views/../../bower_components/jquery-resizable-columns/dist/jquery.resizableColumns.js",function(){});var l=function(a,b){return function(){return a.apply(b,arguments)}},i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/row_list",["views/row","views/empty","views/loading","templates/table","../../bower_components/jquery-resizable-columns/dist/jquery.resizableColumns.js"],function(a,b,f,g){var h;return h=function(e){function h(){return this.updateClasses=l(this.updateClasses,this),this.fetched=l(this.fetched,this),this.setSort=l(this.setSort,this),this.sortChanged=l(this.sortChanged,this),h.__super__.constructor.apply(this,arguments)}return i(h,e),h.prototype.template=g,h.prototype.childView=a,h.prototype.collectionEvents={sync:"fetched",reset:"fetched"},h.prototype.ui={selectAllCheckbox:"thead th.select-all input",rowCheckboxes:"td.checkbox input",sortableColHeader:"thead th.sortable",thead:"thead",table:"table"},h.prototype.events={"click @ui.selectAllCheckbox":"toggleSelectAll","click @ui.rowCheckboxes":"selectIntermediateCheckboxes","click th.sortable":"sortChanged"},h.prototype.childViewContainer="tbody",h.prototype.sortColumn=null,h.prototype.sortDirection=null,h.prototype.attributes={class:"wrap"},h.prototype.initialize=function(a){return null==a&&(a={}),this.htmlID=a.htmlID,this.columns=a.columns,this.static=!!a.static,this.selectable=!!a.selectable,this.tableSelections=a.tableSelections,this.emptyView=a.emptyView||a.tableEmptyView||b,this.loadingView=a.loadingView||f,this.controller=a,this.setSort(this.collection.sortColumn,this.collection.sortDirection,{noReload:!0}),this.selectable&&(this.selectedIDs={},this.deselectedIDs={}),this.static||(this.originalEmptyView=this.emptyView,this.emptyView=this.loadingView),this.listenTo(this.collection,"remove:multiple:after",function(a){return function(){return a.handleRemoveMultiple()}}(this))},h.prototype.sortChanged=function(a){var b,d;return d=c(a.currentTarget).index(),this.selectable&&d--,this.trigger("table:sort",{attribute:null!=(b=this.columns[d])?b.attribute:void 0})},h.prototype.setSort=function(a,b,c){var e,f;return this.sortColumn=a,this.sortDirection=b,null==c&&(c={}),f=d.indexOf(this.columns,d.findWhere(this.columns,{attribute:this.sortColumn})),this.selectable&&f++,this.$el.find("thead th").removeClass("sort asc desc").eq(f).addClass("sort "+this.sortDirection),this.selectable&&f--,c.noReload?void 0:this.collection.setSort(this.sortColumn,this.sortDirection,null!=(e=this.columns[f])?e.sortAttribute:void 0)},h.prototype.setSearch=function(a){return this.collection.setSearch(a)},h.prototype.getRowCheckboxes=function(){return this.$el.find("td.checkbox input")},h.prototype.toggleSelectAll=function(){var a;return a=this.getRowCheckboxes(),this.ui.selectAllCheckbox.prop("checked")?(this.tableSelections.selectAllState=!0,this.tableSelections.deselectedIDs={},d.each(this.collection.models,function(a){return a.set("selected",!0)}),this.controller.carpenterRadio.trigger("table:rows:selected")):(this.tableSelections.selectAllState=!1,this.tableSelections.selectedIDs={},d.each(this.collection.models,function(a){return a.set("selected",!1)}),this.controller.carpenterRadio.trigger("table:rows:deselected")),this.collection.trigger("select_all_toggled"),!0},h.prototype.selectIntermediateCheckboxes=function(a){var b,d,e,f;return a.shiftKey&&this.previouslySelected&&(f=c(a.target).is(":checked"),b=c(a.target).parents("tr").prevAll(),e=c(a.target).parents("tr").nextAll(),d=c("tr").find(this.previouslySelected),b.has(d).length>0?c(a.target).parents("tr").prevUntil(c("tr").has(d)).find("td.checkbox input").prop("checked",f).change():e.has(d).length>0&&c(a.target).parents("tr").nextUntil(c("tr").has(d)).find("td.checkbox input").prop("checked",f).change()),this.previouslySelected=c(a.target)},h.prototype.handleRemoveMultiple=function(){return 0===this.collection.length?this.ui.selectAllCheckbox.prop("checked",!1):void 0},h.prototype.fetched=function(){return this.originalEmptyView?(this.emptyView=this.originalEmptyView,this.originalEmptyView=null,this.render()):this.updateClasses()},h.prototype.buildChildView=function(a,b){return new b({model:a,columns:this.columns,selectable:this.selectable,tableSelections:this.tableSelections,serverAPI:this.collection.server_api,controller:this.controller})},h.prototype.serializeData=function(){return this},h.prototype.updateClasses=function(){var a,b;return"function"==typeof(a=this.ui.table).toggleClass&&a.toggleClass("loaded",!0),"function"==typeof(b=this.ui.table).toggleClass?b.toggleClass("populated",!0):void 0},h.prototype.onRender=function(){return this.ui.table.resizableColumns(),this.updateClasses()},h}(e.CompositeView)}),h("templates/selection_indicator",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){d(b('
')),d(this.numSelected),d(b(" of ")),d(this.totalRecords),d(b(" selected
"))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a});var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/selection_indicator",["templates/selection_indicator"],function(a){var b;return b=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return i(c,b),c.prototype.template=a,c.prototype.initialize=function(a){var b,c;return null==a&&(a={}),this.tableSelections=a.tableSelections,this.tableCollection=a.tableCollection,b=["selection_toggled","select_all_toggled","remove:multiple:after"],d.each(b,function(a){return function(b){return a.listenTo(a.tableCollection,b,function(){return a.calculateNumSelected()})}}(this)),c=["sync","change:numSelected"],d.each(c,function(a){return function(b){return a.listenTo(a.tableCollection,b,function(){return a.render()})}}(this))},c.prototype.calculateNumSelected=function(){var a;return this.tableCollection.totalRecords?(a=this.tableSelections.selectAllState?this.tableCollection.totalRecords-Object.keys(this.tableSelections.deselectedIDs).length:Object.keys(this.tableSelections.selectedIDs).length,this.tableCollection.updateNumSelected(a)):0},c.prototype.serializeData=function(){return{numSelected:this.tableCollection.numSelected,totalRecords:this.tableCollection.totalRecords}},c}(e.ItemView)});var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty,l=function(a,b){return function(){return a.apply(b,arguments)}};return h("controllers/table_controller",["controllers/application_controller","entities/paginated_collection","entities/action_buttons_collection","entities/action_button","entities/filter","views/control_bar","views/empty","views/header","views/layout","views/loading","views/paginator","views/row","views/row_list","views/selection_indicator","utilities/string_utils"],function(a,b,f,g,h,j,k,m,n,o,p,q,r,s,t){return e.Carpenter={},e.Carpenter.CellController=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return i(b,a),b}(a),e.Carpenter.Controller=function(a){function e(){return this.toggleInteraction=l(this.toggleInteraction,this),this.setPerPage=l(this.setPerPage,this),this.totalPages=l(this.totalPages,this),this.totalRecords=l(this.totalRecords,this),this.last=l(this.last,this),this.first=l(this.first,this),this.previous=l(this.previous,this),this.next=l(this.next,this),this.refresh=l(this.refresh,this),e.__super__.constructor.apply(this,arguments)}return i(e,a),e.prototype.showView=!0,e.prototype.selectable=!1,e.prototype.filterTemplatePath="",e.prototype.taggable=!1,e.prototype.title=null,e.prototype.static=!1,e.prototype.fetch=!0,e.prototype.defaultSort=null,e.prototype.actionButtons=[],e.prototype.columns=[],e.prototype.perPageOptions=[20,50,100,"All"],e.prototype.perPage=20,e.prototype.columnDefaults={sortable:!0,escape:!0,escapeLabel:!0,defaultDirection:"desc"},e.prototype.header=null,e.prototype.buttons=null,e.prototype.list=null,e.prototype.paginator=null,e.prototype.initialize=function(a){var c,e,g;return null==a&&(a={}),d.extend(this,a),d.each(this.columns,function(a){return function(b){return d.defaults(b,a.columnDefaults),d.defaults(b,{label:t.humanize(b.attribute)})}}(this)),this.static=!!this.static,c=b(this.collection,this),this.collection=new c(this.collection.models),"function"==typeof(e=this.collection).rebind&&e.rebind(),this.setMainView(new n(this)),this.collection.perPage=this.perPage,this.collection.sortColumn=null!=(g=this.defaultSortColumn())?g.attribute:void 0,this.collection.sortDirection=this.defaultSortDirection(),this.static||this.collection.updateSortKey(),this.tableCollection=this.collection,this.tableSelections={},this.selectable&&(this.tableSelections.selectAllState=!1,this.tableSelections.selectedIDs={},this.tableSelections.deselectedIDs={}),this.actionButtonsCollection=new f(a.actionButtons),this.header=new m(this),this.buttons=new j(this),this.list=new r(this),this.paginator=new p(this),this.selectable&&(this.selectionIndicator=new s(this)),this.listenTo(this.collection,"reset",function(a){return function(){return a.toggleInteraction(!0)}}(this)),this.listenTo(this.collection,"sync",function(a){return function(){return a.toggleInteraction(!0)}}(this)),this.listenTo(this.collection,"change",function(a){return function(){return a.toggleInteraction(!0)}}(this)),this.listenTo(this.collection,"error",function(a){return function(){return a.toggleInteraction(!0)}}(this)),this.listenTo(this.collection,"remove:multiple",function(a){return function(b){return d.each(b,function(b){return delete a.tableSelections.selectedIDs[b]}),a.collection.trigger("remove:multiple:after"),a.toggleInteraction(!1),a.tableCollection.fetch()}}(this)),this.listenTo(this.getMainView(),"show",function(a){return function(){return a.show(a.header,{region:null!=a.headerRegion?a.headerRegion:a.getMainView().headerRegion}),a.show(a.buttons,{region:null!=a.buttonsRegion?a.buttonsRegion:a.getMainView().buttonsRegion}),a.show(a.list,{region:null!=a.tableRegion?a.tableRegion:a.getMainView().tableRegion}),a.show(a.paginator,{region:null!=a.paginationRegion?a.paginationRegion:a.getMainView().paginationRegion}),a.selectable&&a.show(a.selectionIndicator,{region:null!=a.selectionIndicatorRegion?a.selectionIndicatorRegion:a.getMainView().selectionIndicatorRegion,preventDestroy:!1}),"function"==typeof a.onShow?a.onShow(a):void 0}}(this)),this.listenTo(this.paginator,"table:first",this.first),this.listenTo(this.paginator,"table:previous",this.previous),this.listenTo(this.paginator,"table:next",this.next),this.listenTo(this.paginator,"table:last",this.last),this.listenTo(this.paginator,"table:setPerPage",function(a){return function(){var b,c;return c=a.paginator.ui.perPage.val(),a.perPage!==c?(b=c>a.perPage,a.setPerPage(c),b?a.toggleInteraction(!1):void 0):void 0}}(this)),this.listenTo(this.paginator,"table:pageInputChanged",d.debounce(function(a){return function(b){var c,e;if(e=parseInt(a.paginator.ui.pageInput.val()),null!=e&&d.isNumber(e)&&!d.isNaN(e)&&e!==a.collection.currentPage){if(c=Math.min(Math.max(1,e),a.totalPages()),c!==e&&a.paginator.ui.pageInput.val(c),c===a.collection.currentPage)return;return a.collection.goTo(c),a.toggleInteraction(!1),d.defer(function(){return a.paginator.ui.pageInput.click()})}}}(this),300)),this.listenTo(this.list,"table:sort",function(a){return function(b){var c,e;return null==b&&(b={}),e=d.findWhere(a.columns,{attribute:b.attribute}),c=a.list.sortColumn===b.attribute?"asc"===a.list.sortDirection?"desc":"asc":a.list.sortDirection||(null!=e?e.defaultDirection:void 0)||"desc",a.toggleInteraction(!1),(null!=e?e.sortable:void 0)?a.list.setSort(e.attribute,c,e.sortAttribute):void 0}}(this)),this.static?this.collection.bootstrap():this.fetch&&this.collection.fetch({reset:!0}),this.showView?this.show(this.getMainView(),{region:a.region}):void 0},e.prototype.refresh=function(a){return null==a&&(a={}),d.defaults(a,{reset:!0}),this.toggleInteraction(!1),this.collection.fetch(a)},e.prototype.next=function(){return this.toggleInteraction(!1),this.collection.nextPage()},e.prototype.previous=function(){return this.toggleInteraction(!1),this.collection.prevPage()},e.prototype.first=function(){return this.toggleInteraction(!1),this.collection.goTo(1)},e.prototype.last=function(){return this.toggleInteraction(!1),this.collection.goTo(this.totalPages())},e.prototype.totalRecords=function(){return null!=this.collection.totalRecords?this.collection.totalRecords:null!=this.collection.origModels?this.collection.origModels.length:null!=this.collection.models?this.collection.models.length:0},e.prototype.totalPages=function(){return this.totalRecords()%this.collection.perPage===0?Math.floor(this.totalRecords()/this.collection.perPage):Math.floor(this.totalRecords()/this.collection.perPage)+1},e.prototype.setPerPage=function(a){return this.paginator.perPage=this.perPage=a,this.collection.howManyPer(a)},e.prototype.defaultSortColumn=function(){return d.findWhere(this.columns,{attribute:this.defaultSort})||d.findWhere(this.columns,{sortable:!0})},e.prototype.defaultSortDirection=function(){var a,b;return a=null!=(b=this.defaultSortColumn())?b.defaultDirection:void 0,d.contains(["asc","desc"],a)&&a||"desc"},e.prototype.showColumn=function(a){return c("tr ."+a).show(),this.triggerMethod("show:column")},e.prototype.hideColumn=function(a){return c("tr ."+a).hide(),this.triggerMethod("hide:column")},e.prototype.toggleInteraction=function(a){var b,c;return a&&this.carpenterRadio.trigger("total_records:change",this.totalRecords()),this.isInteractionEnabled!==a?(this.static||(this.isInteractionEnabled=a,c="a,th,select,input",b=this.buttons.$el.find(c),this.getMainView().$el.find(c).not(b).toggleClass("disabled",!a),b.toggleClass("action-disabled",!a)),a?this.paginator.render():void 0):void 0},e}(a),e.Carpenter.create=function(a){var b;return null==a&&(a={}),a.showView=!1,b=new e.Carpenter.Controller(a),b.getMainView()},e.Carpenter.Controller}),g("controllers/table_controller")}); \ No newline at end of file +!function(a,b){var c=["cocktail","jquery","underscore","marionette","backbone.radio"];if("function"==typeof define&&define.amd)define("carpenter",c,function(c,d,e,f){return a.Carpenter=b(a,c,d,e,f)});else if("undefined"!=typeof exports){var d=require("cocktail"),e=require("jquery"),f=require("underscore"),g=require("marionete");module.exports=b(a,d,e,f,g)}else a.Carpenter=b(a,a.Cocktail,a.$,a._,a.Marionette)}(this,function(a,b,c,d,e){var f,g,h;!function(a){function b(a,b){return u.call(a,b)}function c(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function d(b,c){return function(){return n.apply(a,v.call(arguments,0).concat([b,c]))}}function e(a){return function(b){return c(b,a)}}function i(a){return function(b){q[a]=b}}function j(c){if(b(r,c)){var d=r[c];delete r[c],t[c]=!0,m.apply(a,d)}if(!b(q,c)&&!b(t,c))throw new Error("No "+c);return q[c]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var d,f=k(a),g=f[0];return a=f[1],g&&(g=c(g,b),d=j(g)),g?a=d&&d.normalize?d.normalize(a,e(b)):c(a,b):(a=c(a,b),f=k(a),g=f[0],a=f[1],g&&(d=j(g))),{f:g?g+"!"+a:a,n:a,pr:g,p:d}},p={require:function(a){return d(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(c,e,f,g){var h,k,l,m,n,s,u=[],v=typeof f;if(g=g||c,"undefined"===v||"function"===v){for(e=!e.length&&f.length?["require","exports","module"]:e,n=0;n\n ')),d(this.label),d(b("\n"))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a});var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty,k=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};h("views/action_button",["templates/action_button"],function(a){var b;return b=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return i(c,b),c.prototype.template=a,c.prototype.tagName="li",c.prototype.className=function(){return this.model.get("containerClass")},c.prototype.modelEvents={"change:disabled":"render"},c.prototype.events={click:"executeClickActions"},c.prototype.initialize=function(a){return this.carpenter=a.carpenter,this.selectable=!!a.selectable,this.tableCollection=a.tableCollection,this.tableSelections=a.tableSelections,this.listenTo(this.tableCollection,"selection_toggled",function(a){return function(){return a.setActivationState()}}(this)),this.listenTo(this.tableCollection,"select_all_toggled",function(a){return function(){return a.setActivationState()}}(this))},c.prototype.setActivationState=function(a){var b,c,d,e;return b=this.model.get("activateOn"),this.selectable&&b?(d=this.tableCollection.numSelected,c=this.tableSelections.selectAllState||d>1,e=1===d,"any"===b&&(e||c)?this.model.enable():"many"===b&&c?this.model.enable():"one"===b&&e&&!this.tableSelections.selectAllState?this.model.enable():this.model.disable()):(this.model.enable(),!1)},c.prototype.executeClickActions=function(){return null==this.model.get("disabled")||null!=this.model.get("disabled")&&!this.model.get("disabled")?(this.executeCallback(),this.executeTrigger()):void 0},c.prototype.executeTrigger=function(){return this.model.get("event")?this.carpenterRadio.trigger(this.model.get("event")):void 0},c.prototype.executeCallback=function(){var a,b,c,d;return this.model.get("click")?this.selectable?(b=this.tableSelections.selectAllState,c=Object.keys(this.tableSelections.selectedIDs),a=Object.keys(this.tableSelections.deselectedIDs),d=new Backbone.Collection(this.tableCollection.filter(function(a){var b;return b=a.id,k.call(c,b)>=0})),this.model.get("click")(b,c,a,d,this.tableCollection)):this.model.get("click")():!1},c}(e.ItemView)});var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/control_bar",["views/action_button"],function(a){var b;return b=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return i(c,b),c.prototype.childView=a,c.prototype.tagName="ul",c.prototype.className="table-control-bar",c.prototype.initialize=function(a){return null==a&&(a={}),this.collection=a.actionButtonsCollection,this.columns=a.columns,this.tableSelections=a.tableSelections,this.tableCollection=a.tableCollection,this.selectable=!!a.selectable,this.carpenter=a.carpenter,c.__super__.initialize.apply(this,arguments)},c.prototype.buildChildView=function(a,b,c){var e,f;return e={tableSelections:this.tableSelections,tableCollection:this.tableCollection,selectable:this.selectable,model:a},f=d.extend(e,c),new b(f)},c.prototype.serializeData=function(){return this},c}(e.CollectionView)}),h("templates/empty",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){d(b("No items were found."))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a});var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/empty",["templates/empty"],function(a){var b;return b=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return i(c,b),c.prototype.template=a,c.prototype.tagName="tr",c.prototype.attributes={"class":"empty"},c}(e.ItemView)}),h("templates/header",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){this.title&&this.title.length&&(d(b("\n \n ")),d(this.title),d(b("\n \n"))),d(b("\n\n
\n ")),this.searchable&&d(b("\n \n ")),d(b("\n
\n"))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a});var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/header",["templates/header"],function(a){var b;return b=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return i(c,b),c.prototype.template=a,c.prototype.attributes={"class":"table-header"},c.prototype.initialize=function(a){return null==a&&(a={}),this.title=a.title,this.taggable=!!a.taggable,this.htmlID=a.htmlID},c.prototype.serializeData=function(){return this},c}(e.ItemView)}),h("templates/layout",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){d(b("\n
\n
\n\n")),d(b("\n
\n
\n\n")),d(b("\n
\n
\n\n
\n
\n\n
\n ")),d(b("\n
\n
\n\n ")),d(b("\n
\n
\n
\n\n")),d(b("\n
\n
\n"))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a});var l=function(a,b){return function(){return a.apply(b,arguments)}},i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/layout",["templates/layout"],function(a){var b;return b=function(b){function e(){return this._modelForTd=l(this._modelForTd,this),this._columnForTd=l(this._columnForTd,this),this.mouseEnteredTableCell=l(this.mouseEnteredTableCell,this),this.mouseEnteredTableHeader=l(this.mouseEnteredTableHeader,this),e.__super__.constructor.apply(this,arguments)}return i(e,b),e.prototype.template=a,e.prototype.regions={headerRegion:".header-region",filterRegion:".filter-region",buttonsRegion:".buttons-region",tableRegion:".table-region",paginationRegion:".pagination-region",overlayRegion:".overlay-region",selectionIndicatorRegion:".selection-indicator-region"},e.prototype.events={"mouseenter td":"mouseEnteredTableCell","mouseenter th":"mouseEnteredTableHeader"},e.prototype.attributes={"class":"table-component foundation"},e.prototype.initialize=function(a){return null==a&&(a={}),d.extend(this.regions,null!=a?a.regions:void 0),this.controller=a,this.columns=a.columns,this.collection=a.collection,this.selectable=!!a.selectable},e.prototype.serializeData=function(){return this},e.prototype.mouseEnteredTableHeader=function(a){return this.overlayRegion.reset()},e.prototype.mouseEnteredTableCell=function(a){var b,d,e,f,g;if(b=this._columnForTd(a.currentTarget),e=this._modelForTd(a.currentTarget),null!=(null!=b?b.hoverView:void 0)){if(null!=(null!=b?b.hoverOn:void 0)&&!b.hoverOn.call({model:e,column:b}))return;return d=new b.hoverView({model:e,column:b}),g=c(a.currentTarget).position(),g.top+=c(a.currentTarget).outerHeight()-2,g.width=c(a.currentTarget).outerWidth(),this.overlayRegion.show(d),null!=(f=this.overlayRegion.$el)?f.css(g):void 0}return this.overlayRegion.reset()},e.prototype._columnForTd=function(a){var b;return b=c(a).index(),this.selectable&&b--,this.columns[b]},e.prototype._modelForTd=function(a){var b;return b=c(a).parent("tr").index(),this.collection.models[b]},e}(e.LayoutView)}),h("templates/loading",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){d(b("\n"))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a});var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/loading",["templates/loading"],function(a){var b;return b=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return i(c,b),c.prototype.template=a,c.prototype.tagName="tr",c}(e.ItemView)}),h("templates/paginator",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){var a,c,e,f,g;if(this.collection.length>0){for(d(b("\n
\n \n\n \n Showing ")),d((this.currentPage-1)*this.perPage+1),d(b(" - ")),d(this.lastRow),d(b(" of ")),d(this.totalRecords),d(b("\n \n
\n\n \n"))}d(b("\n"))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a}),Backbone.Paginator=function(a,b,c){"use strict";var d=b.map(a.VERSION.split("."),function(a){return parseInt(a,10)}),e={};e.version="1.0.0-dev",e.clientPager=a.Collection.extend({useDiacriticsPlugin:!0,useLevenshteinPlugin:!0,sortColumn:"",sortDirection:"desc",lastSortColumn:"",fieldFilterRules:[],lastFieldFilterRules:[],filterFields:"",filterExpression:"",lastFilterExpression:"",defaults_ui:{firstPage:0,currentPage:1,perPage:5,totalPages:10,pagesInRange:4},initialize:function(){this.on("add",this.addModel,this),this.on("remove",this.removeModel,this),this.setDefaults()},setDefaults:function(){var a=b.defaults(this.paginator_ui,this.defaults_ui);b.defaults(this,a)},addModel:function(a){this.origModels.push(a)},removeModel:function(a){var c=b.indexOf(this.origModels,a);this.origModels.splice(c,1)},sync:function(e,f,g){var h=this;this.setDefaults();var i={};b.each(b.result(h,"server_api"),function(a,c){b.isFunction(a)&&(a=b.bind(a,h),a=a()),i[c]=a});var j=b.clone(h.paginator_core);b.each(j,function(a,c){b.isFunction(a)&&(a=b.bind(a,h),a=a()),j[c]=a}),j=b.defaults(j,{timeout:25e3,cache:!1,type:"GET",dataType:"jsonp"}),j=b.extend(j,{data:decodeURIComponent(c.param(i)),processData:!1,url:b.result(j,"url")},g);var k=!(0===d[0]&&9===d[1]&&10===d[2]),l=0===d[0],m=j.success;j.success=function(a,b,c){m&&(k?m(a,b,c):m(f,a,j)),l&&f&&f.trigger&&f.trigger("sync",f,a,j)};var n=j.error;j.error=function(a){n&&n(a),l&&f&&f.trigger&&f.trigger("error",f,a,j)};var o=j.xhr=a.ajax(j);return f&&f.trigger&&f.trigger("request",f,o,j),o},nextPage:function(a){this.currentPage1&&(this.currentPage=--this.currentPage,this.pager(a))},goTo:function(a,b){void 0!==a&&(this.currentPage=parseInt(a,10),this.pager(b))},howManyPer:function(a){if(void 0!==a){var b=this.perPage;this.perPage=parseInt(a,10),this.currentPage=Math.ceil((b*(this.currentPage-1)+1)/a),this.pager()}},setSort:function(a,b){void 0!==a&&void 0!==b&&(this.lastSortColumn=this.sortColumn,this.sortColumn=a,this.sortDirection=b,this.pager(),this.info())},setFieldFilter:function(a){b.isEmpty(a)?(this.lastFieldFilterRules=this.fieldFilterRules,this.fieldFilterRules="",this.pager(),this.info()):(this.lastFieldFilterRules=this.fieldFilterRules,this.fieldFilterRules=a,this.pager(),this.info())},doFakeFieldFilter:function(a){if(!b.isEmpty(a)){var c=this.origModels;return void 0===c&&(c=this.models),c=this._fieldFilter(c,a),""!==this.filterExpression&&(c=this._filter(c,this.filterFields,this.filterExpression)),c.length}},setFilter:function(a,b){void 0!==a&&void 0!==b&&(this.filterFields=a,this.lastFilterExpression=this.filterExpression,this.filterExpression=b,this.pager(),this.info())},doFakeFilter:function(a,c){if(void 0!==a&&void 0!==c){var d=this.origModels;return void 0===d&&(d=this.models),b.isEmpty(this.fieldFilterRules)||(d=this._fieldFilter(d,this.fieldFilterRules)),d=this._filter(d,a,c),d.length}},pager:function(a){var c=this,d=this.perPage,e=(c.currentPage-1)*d,f=e+d;void 0===c.origModels&&(c.origModels=c.models),c.models=c.origModels.slice(),""!==this.sortColumn&&(c.models=c._sort(c.models,this.sortColumn,this.sortDirection)),b.isEmpty(this.fieldFilterRules)||(c.models=c._fieldFilter(c.models,this.fieldFilterRules)),""!==this.filterExpression&&(c.models=c._filter(c.models,this.filterFields,this.filterExpression)),this.lastSortColumn===this.sortColumn&&this.lastFilterExpression===this.filterExpression&&b.isEqual(this.fieldFilterRules,this.lastFieldFilterRules)||(e=0,f=e+d,c.currentPage=1,this.lastSortColumn=this.sortColumn,this.lastFieldFilterRules=this.fieldFilterRules,this.lastFilterExpression=this.filterExpression),c.sortedAndFilteredModels=c.models.slice(),c.info(),c.reset(c.models.slice(e,f)),b.result(a,"success")},_sort:function(a,c,d){return a=a.sort(function(a,e){var f=a.get(c),g=e.get(c);if(b.isUndefined(f)||b.isUndefined(g)||null===f||null===g)return 0;if(f=f.toString().toLowerCase(),g=g.toString().toLowerCase(),"desc"===d)if(!f.match(/[^\-\d\.]/)&&f.match(/-?[\d\.]+/)&&!g.match(/[^\-\d\.]/)&&g.match(/-?[\d\.]+/)){if(g-0>f-0)return 1;if(f-0>g-0)return-1}else{if(g>f)return 1;if(f>g)return-1}else if(!f.match(/[^\-\d\.]/)&&f.match(/-?[\d\.]+/)&&!g.match(/[^\-\d\.]/)&&g.match(/-?[\d\.]+/)){if(g-0>f-0)return-1;if(f-0>g-0)return 1}else{if(g>f)return-1;if(f>g)return 1}if(a.cid&&e.cid){var h=a.cid,i=e.cid;if(i>h)return-1;if(h>i)return 1}return 0})},_fieldFilter:function(a,c){if(b.isEmpty(c))return a;var d=[];return b.each(a,function(a){var e=!0;b.each(c,function(c){if(!e)return!1;if(e=!1,"function"===c.type){var d=b.wrap(c.value,function(b){return b(a.get(c.field))});d()&&(e=!0)}else if("required"===c.type)b.isEmpty(a.get(c.field).toString())||(e=!0);else if("min"===c.type)!b.isNaN(Number(a.get(c.field)))&&!b.isNaN(Number(c.value))&&Number(a.get(c.field))>=Number(c.value)&&(e=!0);else if("max"===c.type)!b.isNaN(Number(a.get(c.field)))&&!b.isNaN(Number(c.value))&&Number(a.get(c.field))<=Number(c.value)&&(e=!0);else if("range"===c.type)!b.isNaN(Number(a.get(c.field)))&&b.isObject(c.value)&&!b.isNaN(Number(c.value.min))&&!b.isNaN(Number(c.value.max))&&Number(a.get(c.field))>=Number(c.value.min)&&Number(a.get(c.field))<=Number(c.value.max)&&(e=!0);else if("minLength"===c.type)a.get(c.field).toString().length>=c.value&&(e=!0);else if("maxLength"===c.type)a.get(c.field).toString().length<=c.value&&(e=!0);else if("rangeLength"===c.type)b.isObject(c.value)&&!b.isNaN(Number(c.value.min))&&!b.isNaN(Number(c.value.max))&&a.get(c.field).toString().length>=c.value.min&&a.get(c.field).toString().length<=c.value.max&&(e=!0);else if("oneOf"===c.type)b.isArray(c.value)&&b.include(c.value,a.get(c.field))&&(e=!0);else if("equalTo"===c.type)c.value===a.get(c.field)&&(e=!0);else if("containsAllOf"===c.type)b.isArray(c.value)&&b.isArray(a.get(c.field))&&b.intersection(c.value,a.get(c.field)).length===c.value.length&&(e=!0);else if("pattern"===c.type)a.get(c.field).toString().match(c.value)&&(e=!0);else if("custom"===c.type){var f=a.toJSON(),g=b.wrap(c.value,function(a){return a(f)});g()&&(e=!0)}else e=!1}),e&&d.push(a)}),d},_filter:function(c,d,e){var f=this,g={};if(b.isString(d)?g[d]={cmp_method:"regexp"}:b.isArray(d)?b.each(d,function(a){g[a]={cmp_method:"regexp"}}):b.each(d,function(a,c){g[c]=b.defaults(a,{cmp_method:"regexp"})}),d=g,b.has(a.Paginator,"removeDiacritics")&&f.useDiacriticsPlugin&&(e=a.Paginator.removeDiacritics(e)),""===e||!b.isString(e))return c;var h=b.map(e.match(/\w+/gi),function(a){return a.toLowerCase()}),i="("+b.uniq(h).join("|")+")",j=new RegExp(i,"igm"),k=[];return b.each(c,function(c){var g=[];b.each(d,function(d,i){var k=c.get(i);if(k){var l=[];if(k=b.has(a.Paginator,"removeDiacritics")&&f.useDiacriticsPlugin?a.Paginator.removeDiacritics(k.toString()):k.toString(),"levenshtein"===d.cmp_method&&b.has(a.Paginator,"levenshtein")&&f.useLevenshteinPlugin){var m=a.Paginator.levenshtein(k,e);b.defaults(d,{max_distance:0}),m<=d.max_distance&&(l=b.uniq(h))}else l=k.match(j);l=b.map(l,function(a){return a.toString().toLowerCase()}),b.each(l,function(a){g.push(a)})}}),g=b.uniq(b.without(g,"")),b.isEmpty(b.difference(h,g))&&k.push(c)}),k},info:function(){var a=this,b={},c=a.sortedAndFilteredModels?a.sortedAndFilteredModels.length:a.length,d=Math.ceil(c/a.perPage);return b={totalUnfilteredRecords:a.origModels.length,totalRecords:c,currentPage:a.currentPage,perPage:this.perPage,totalPages:d,lastPage:d,previous:!1,next:!1,startRecord:0===c?0:(a.currentPage-1)*this.perPage+1,endRecord:Math.min(c,a.currentPage*this.perPage)},a.currentPage>1&&(b.previous=a.currentPage-1),a.currentPage1)if(1+e>=f)for(c=1,d=f;d>=c;c++)b.push(c);else if(a.currentPage<=this.pagesInRange+1)for(c=1,d=2+e;d>c;c++)b.push(c);else if(f-this.pagesInRange>a.currentPage&&a.currentPage>this.pagesInRange)for(c=a.currentPage-this.pagesInRange;c<=a.currentPage+this.pagesInRange;c++)b.push(c);else for(c=f-e;f>=c;c++)b.push(c);return b},bootstrap:function(a){return b.extend(this,a),this.goTo(1),this.info(),this}}),e.clientPager.prototype.prevPage=e.clientPager.prototype.previousPage;var f=function(){var a=new c.Deferred;return a.reject(),a.promise()};return e.requestPager=a.Collection.extend({sync:function(e,f,g){var h=this;h.setDefaults();var i={};b.each(b.result(h,"server_api"),function(a,c){b.isFunction(a)&&(a=b.bind(a,h),a=a()),i[c]=a});var j=b.clone(h.paginator_core);b.each(j,function(a,c){b.isFunction(a)&&(a=b.bind(a,h),a=a()),j[c]=a}),j=b.defaults(j,{timeout:25e3,cache:!1,type:"GET",dataType:"jsonp",url:h.url}),g.data?g.data=decodeURIComponent(c.param(b.extend(i,g.data))):g.data=decodeURIComponent(c.param(i)),j=b.extend(j,{data:decodeURIComponent(c.param(i)),processData:!1,url:b.result(j,"url")},g);var k=!(0===d[0]&&9===d[1]&&10===d[2]),l=0===d[0],m=j.success;j.success=function(a,b,c){m&&(k?m(a,b,c):m(f,a,j)),l&&f&&f.trigger&&f.trigger("sync",f,a,j)};var n=j.error;j.error=function(a){n&&n(a),l&&f&&f.trigger&&f.trigger("error",f,a,j)};var o=j.xhr=a.ajax(j);return f&&f.trigger&&f.trigger("request",f,o,j),o},setDefaults:function(){var a=this;b.defaults(a.paginator_ui,{firstPage:0,currentPage:1,perPage:5,totalPages:10,pagesInRange:4}),b.each(a.paginator_ui,function(c,d){b.isUndefined(a[d])&&(a[d]=a.paginator_ui[d])})},requestNextPage:function(a){return void 0!==this.currentPage?(this.currentPage+=1,this.pager(a)):f()},requestPreviousPage:function(a){return void 0!==this.currentPage?(this.currentPage-=1,this.pager(a)):f()},updateOrder:function(a,b){return void 0!==a?(this.sortField=a,this.pager(b)):f()},goTo:function(a,b){return void 0!==a?(this.currentPage=parseInt(a,10),this.pager(b)):f()},howManyPer:function(a,b){return void 0!==a?(this.currentPage=this.firstPage,this.perPage=a,this.pager(b)):f()},info:function(){var a={totalRecords:this.totalRecords||0,currentPage:this.currentPage,firstPage:this.firstPage,totalPages:Math.ceil(this.totalRecords/this.perPage),lastPage:this.totalPages,perPage:this.perPage,previous:!1,next:!1};return this.currentPage>1&&(a.previous=this.currentPage-1),this.currentPage1)if(1+e>=f)for(c=1,d=f;d>=c;c++)b.push(c);else if(a.currentPage<=this.pagesInRange+1)for(c=1,d=2+e;d>c;c++)b.push(c);else if(f-this.pagesInRange>a.currentPage&&a.currentPage>this.pagesInRange)for(c=a.currentPage-this.pagesInRange;c<=a.currentPage+this.pagesInRange;c++)b.push(c);else for(c=f-e;f>=c;c++)b.push(c);return b},pager:function(a){return b.isObject(a)||(a={}),this.fetch(a)},url:function(){return void 0!==this.paginator_core&&void 0!==this.paginator_core.url?this.paginator_core.url:null},bootstrap:function(a){return b.extend(this,a),this.setDefaults(),this.info(),this}}),e.requestPager.prototype.nextPage=e.requestPager.prototype.requestNextPage,e.requestPager.prototype.prevPage=e.requestPager.prototype.requestPreviousPage,e}(Backbone,d,jQuery),h("views/../../bower_components/backbone.paginator/dist/backbone.paginator.js",function(){}); +var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/paginator",["templates/paginator","../../bower_components/backbone.paginator/dist/backbone.paginator.js"],function(a){var b;return b=function(b){function e(){return e.__super__.constructor.apply(this,arguments)}return i(e,b),e.ALL_MAGIC="99999999",e.prototype.template=a,e.prototype.attributes={"class":"paginator"},e.prototype.ui={next:".page_navigation a.next",previous:".page_navigation a.previous",last:".page_navigation a.last",first:".page_navigation a.first",pageInput:".page_navigation input",perPage:".row_select select"},e.prototype.triggers={"click @ui.first":"table:first","click @ui.last":"table:last","click @ui.next":"table:next","click @ui.previous":"table:previous","change @ui.perPage":"table:setPerPage","change @ui.pageInput":"table:pageInputChanged","keyup @ui.pageInput":"table:pageInputChanged"},e.prototype.events={"click @ui.pageInput":"pageInputClicked"},e.prototype.perPage=20,e.prototype.perPageOptions=[20,50,100,"All"],e.prototype.initialize=function(a){return null==a&&(a={}),this.collection=a.collection,this.perPageOptions=a.perPageOptions||this.perPageOptions,this.perPage=a.perPage||this.perPage,this["static"]=!!a["static"],d.contains(this.perPageOptions,this.perPage)||this.perPageOptions.unshift(this.perPage),this["static"]?this.collection.howManyPer(this.perPage):this.collection.perPage=this.perPage,this.listenTo(this.collection,"sync",this.render),this.listenTo(this.collection,"reset",this.render)},e.prototype.pageInputClicked=function(a){return c(a.currentTarget).select()},e.prototype.serializeData=function(){var a,b,c,f;return f=this.collection.totalRecords||(null!=(b=this.collection)&&null!=(c=b.origModels)?c.length:void 0)||0,a=Math.min(this.collection.currentPage*this.collection.perPage,f),d.extend({},this,this.collection,{totalRecords:f,lastRow:a,isLastPage:a===f,isFirstPage:1===this.collection.currentPage,ALL_MAGIC:e.ALL_MAGIC})},e}(e.ItemView)}),h("templates/row",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){var a,c,e,f,g;for(this.selectable&&(d(b('\n \n \n \n"))),d(b("\n\n")),c=0,d(b("\n")),g=this.columns,e=0,f=g.length;f>e;e++)a=g[e],d(b("\n \n ")),null!=a.view?d(b("\n\n ")):null!=a.render?(d(b("\n ")),d(a.render.call(this)),d(b("\n "))):(d(b("\n ")),a.escape?(d(b("\n ")),d(this.model.get(a.attribute)),d(b("\n "))):(d(b("\n ")),d(b(this.model.get(a.attribute))),d(b("\n "))),d(b("\n "))),d(b("\n \n\n ")),c++,d(b("\n"));d(b("\n"))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a}),h("utilities/string_utils",[],function(){var a;return a={underscored:function(a){return a=null===a?"":String(a),a.trim().replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},capitalize:function(a){return a=null===a?"":String(a),a.charAt(0).toUpperCase()+a.slice(1)},humanize:function(b){return a.capitalize(a.underscored(b).replace(/_id$/,"").replace(/_/g," "))}}});var l=function(a,b){return function(){return a.apply(b,arguments)}},i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/row",["templates/row","utilities/string_utils"],function(a,b){var c;return c=function(c){function e(){return this.onShow=l(this.onShow,this),this.selectionStateChanged=l(this.selectionStateChanged,this),e.__super__.constructor.apply(this,arguments)}return i(e,c),e.prototype.template=a,e.prototype.tagName="tr",e.prototype.ui={checkbox:"td.checkbox input"},e.prototype.events={"change @ui.checkbox":"triggerSelectionEvents"},e.prototype.modelEvents={"change:selected":"selectionStateChanged"},e.prototype.initialize=function(a){return null==a&&(a={}),this.columns=a.columns,this.selectable=!!a.selectable,this.tableSelections=a.tableSelections,this.serverAPI=a.serverAPI,this.controller=a.controller,this.setInitialSelectionState(),d.each(this.columns,function(a){return function(b,c){return null!=b.view?a.addRegion(a.regionName(c),"td."+a.regionName(c)):void 0}}(this))},e.prototype.selectionStateChanged=function(){return!!this.ui.checkbox.prop("checked")!==this.model.get("selected")?(this.ui.checkbox.prop("checked",this.model.get("selected")),this.recordSelectionState()):void 0},e.prototype.setInitialSelectionState=function(){return this.selectable?this.tableSelections.selectAllState?this.model.set("selected",!(this.model.id in this.tableSelections.deselectedIDs),{silent:!0}):this.model.set("selected",this.model.id in this.tableSelections.selectedIDs,{silent:!0}):!1},e.prototype.setSelectionState=function(){return this.ui.checkbox.prop("checked")?this.model.set("selected",!0):this.model.set("selected",!1)},e.prototype.recordSelectionState=function(){return this.selectable?this.tableSelections.selectAllState?this.ui.checkbox.prop("checked")?delete this.tableSelections.deselectedIDs[this.model.id]:this.tableSelections.deselectedIDs[this.model.id]=!0:this.ui.checkbox.prop("checked")?this.tableSelections.selectedIDs[this.model.id]=!0:delete this.tableSelections.selectedIDs[this.model.id]:void 0},e.prototype.triggerSelectionEvents=function(){return this.setSelectionState(),this.recordSelectionState(),this.controller.carpenterRadio.trigger("table:row:selection_toggled",this.model),this.model.trigger("selection_toggled"),this.ui.checkbox.prop("checked")?(this.controller.carpenterRadio.trigger("table:row:selected",this.model),this.model.trigger("selected")):(this.controller.carpenterRadio.trigger("table:row:deselected",this.model),this.model.trigger("deselected"))},e.prototype.onShow=function(){return d.each(this.columns,function(a){return function(b,c){var e,f,g,h;if(null!=b.view){if(h=d.extend({},b.viewOpts),d.extend(h,{model:a.model,column:b,collection:a.model.collection,serverAPI:a.serverAPI}),g=new b.view(h),e=g.getMainView?g:null,g=g.getMainView?g.getMainView():g,!g)throw new Error("getMainView() did not return a view instance or "+(null!=g&&null!=(f=g.constructor)?f.name:void 0)+" is not a view instance");return null!=e&&a.listenTo(g,"destroy",e.destroy),a[a.regionName(c)].show(g)}}}(this))},e.prototype.regionName=function(a){return"cell"+a},e.prototype.serializeData=function(){return d.extend({StringUtils:b},this)},e}(e.LayoutView)}),h("templates/table",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){var a,c,e,f,g;for(d(b("\n \n \n ")),this.selectable&&d(b('\n \n ')),d(b("\n\n ")),g=this.columns,e=0,f=g.length;f>e;e++)a=g[e],d(b("\n ")),c=a.attribute===this.sortColumn,d(b('\n \n "));d(b("\n \n \n\n \n\n \n
\n \n \n \n ')),a.escapeLabel?(d(b("\n ")),d(a.label),d(b("\n "))):(d(b("\n ")),d(b(a.label)),d(b("\n "))),d(b("\n \n
\n"))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a});var m=function(a,b){return function(){return a.apply(b,arguments)}},n=[].slice;!function(a,b){var c,d,e,f;return d=function(a){return parseFloat(a.style.width.replace("%",""))},f=function(a,b){return b=b.toFixed(2),a.style.width=""+b+"%"},e=function(a){return 0===a.type.indexOf("touch")?(a.originalEvent.touches[0]||a.originalEvent.changedTouches[0]).pageX:a.pageX},c=function(){function c(c,d){this.pointerdown=m(this.pointerdown,this),this.constrainWidth=m(this.constrainWidth,this),this.options=a.extend({},this.defaults,d),this.$table=c,this.setHeaders(),this.restoreColumnWidths(),this.syncHandleWidths(),a(b).on("resize.rc",function(a){return function(){return a.syncHandleWidths()}}(this)),this.options.start&&this.$table.bind("column:resize:start.rc",this.options.start),this.options.resize&&this.$table.bind("column:resize.rc",this.options.resize),this.options.stop&&this.$table.bind("column:resize:stop.rc",this.options.stop)}return c.prototype.defaults={selector:"tr th:visible",store:b.store,syncHandlers:!0,resizeFromBody:!0,maxWidth:null,minWidth:null},c.prototype.triggerEvent=function(b,c,d){var e;return e=a.Event(b),e.originalEvent=a.extend({},d),this.$table.trigger(e,[this].concat(c||[]))},c.prototype.getColumnId=function(a){return this.$table.data("resizable-columns-id")+"-"+a.data("resizable-column-id")},c.prototype.setHeaders=function(){return this.$tableHeaders=this.$table.find(this.options.selector),this.assignPercentageWidths(),this.createHandles()},c.prototype.destroy=function(){return this.$handleContainer.remove(),this.$table.removeData("resizableColumns"),this.$table.add(b).off(".rc")},c.prototype.assignPercentageWidths=function(){return this.$tableHeaders.each(function(b){return function(c,d){var e;return e=a(d),f(e[0],e.outerWidth()/b.$table.width()*100)}}(this))},c.prototype.createHandles=function(){var b;return null!=(b=this.$handleContainer)&&b.remove(),this.$table.before(this.$handleContainer=a("
")),this.$tableHeaders.each(function(b){return function(c,d){var e;if(0!==b.$tableHeaders.eq(c+1).length&&null==b.$tableHeaders.eq(c).attr("data-noresize")&&null==b.$tableHeaders.eq(c+1).attr("data-noresize"))return e=a("
"),e.data("th",a(d)),e.appendTo(b.$handleContainer)}}(this)),this.$handleContainer.on("mousedown touchstart",".rc-handle",this.pointerdown)},c.prototype.syncHandleWidths=function(){return this.$handleContainer.width(this.$table.width()).find(".rc-handle").each(function(b){return function(c,d){var e;return e=a(d),e.css({left:e.data("th").outerWidth()+(e.data("th").offset().left-b.$handleContainer.offset().left),height:b.options.resizeFromBody?b.$table.height():b.$table.find("thead").height()})}}(this))},c.prototype.saveColumnWidths=function(){return this.$tableHeaders.each(function(b){return function(c,e){var f;return f=a(e),null==f.attr("data-noresize")&&null!=b.options.store?b.options.store.set(b.getColumnId(f),d(f[0])):void 0}}(this))},c.prototype.restoreColumnWidths=function(){return this.$tableHeaders.each(function(b){return function(c,d){var e,g;return e=a(d),null!=b.options.store&&(g=b.options.store.get(b.getColumnId(e)))?f(e[0],g):void 0}}(this))},c.prototype.totalColumnWidths=function(){var b;return b=0,this.$tableHeaders.each(function(c){return function(c,d){return b+=parseFloat(a(d)[0].style.width.replace("%",""))}}(this)),b},c.prototype.constrainWidth=function(a){return null!=this.options.minWidth&&(a=Math.max(this.options.minWidth,a)),null!=this.options.maxWidth&&(a=Math.min(this.options.maxWidth,a)),a},c.prototype.pointerdown=function(b){var c,g,h,i,j,k,l;return b.preventDefault(),h=a(b.currentTarget.ownerDocument),k=e(b),c=a(b.currentTarget),g=c.data("th"),i=this.$tableHeaders.eq(this.$tableHeaders.index(g)+1),l={left:d(g[0]),right:d(i[0])},j={left:l.left,right:l.right},this.$handleContainer.add(this.$table).addClass("rc-table-resizing"),g.add(i).add(c).addClass("rc-column-resizing"),this.triggerEvent("column:resize:start",[g,i,j.left,j.right],b),h.on("mousemove.rc touchmove.rc",function(a){return function(b){var c;return c=(e(b)-k)/a.$table.width()*100,f(g[0],j.left=a.constrainWidth(l.left+c)),f(i[0],j.right=a.constrainWidth(l.right-c)),null!=a.options.syncHandlers&&a.syncHandleWidths(),a.triggerEvent("column:resize",[g,i,j.left,j.right],b)}}(this)),h.one("mouseup touchend",function(a){return function(){return h.off("mousemove.rc touchmove.rc"),a.$handleContainer.add(a.$table).removeClass("rc-table-resizing"),g.add(i).add(c).removeClass("rc-column-resizing"),a.syncHandleWidths(),a.saveColumnWidths(),a.triggerEvent("column:resize:stop",[g,i,j.left,j.right],b)}}(this))},c}(),a.fn.extend({resizableColumns:function(){var b,d;return d=arguments[0],b=2<=arguments.length?n.call(arguments,1):[],this.each(function(){var e,f;return e=a(this),f=e.data("resizableColumns"),f||e.data("resizableColumns",f=new c(e,d)),"string"==typeof d?f[d].apply(f,b):void 0})}})}(window.jQuery,window),h("views/../../bower_components/jquery-resizable-columns/dist/jquery.resizableColumns.js",function(){});var l=function(a,b){return function(){return a.apply(b,arguments)}},i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/row_list",["views/row","views/empty","views/loading","templates/table","../../bower_components/jquery-resizable-columns/dist/jquery.resizableColumns.js"],function(a,b,f,g){var h;return h=function(e){function h(){return this.updateClasses=l(this.updateClasses,this),this.fetched=l(this.fetched,this),this.setSort=l(this.setSort,this),this.sortChanged=l(this.sortChanged,this),h.__super__.constructor.apply(this,arguments)}return i(h,e),h.prototype.template=g,h.prototype.childView=a,h.prototype.collectionEvents={sync:"fetched",reset:"fetched"},h.prototype.ui={selectAllCheckbox:"thead th.select-all input",rowCheckboxes:"td.checkbox input",sortableColHeader:"thead th.sortable",thead:"thead",table:"table"},h.prototype.events={"click @ui.selectAllCheckbox":"toggleSelectAll","click @ui.rowCheckboxes":"selectIntermediateCheckboxes","click th.sortable":"sortChanged"},h.prototype.childViewContainer="tbody",h.prototype.sortColumn=null,h.prototype.sortDirection=null,h.prototype.attributes={"class":"wrap"},h.prototype.initialize=function(a){return null==a&&(a={}),this.htmlID=a.htmlID,this.columns=a.columns,this["static"]=!!a["static"],this.selectable=!!a.selectable,this.tableSelections=a.tableSelections,this.emptyView=a.emptyView||a.tableEmptyView||b,this.loadingView=a.loadingView||f,this.controller=a,this.setSort(this.collection.sortColumn,this.collection.sortDirection,{noReload:!0}),this.selectable&&(this.selectedIDs={},this.deselectedIDs={}),this["static"]||(this.originalEmptyView=this.emptyView,this.emptyView=this.loadingView),this.listenTo(this.collection,"remove:multiple:after",function(a){return function(){return a.handleRemoveMultiple()}}(this))},h.prototype.sortChanged=function(a){var b,d;return d=c(a.currentTarget).index(),this.selectable&&d--,this.trigger("table:sort",{attribute:null!=(b=this.columns[d])?b.attribute:void 0})},h.prototype.setSort=function(a,b,c){var e,f;return this.sortColumn=a,this.sortDirection=b,null==c&&(c={}),f=d.indexOf(this.columns,d.findWhere(this.columns,{attribute:this.sortColumn})),this.selectable&&f++,this.$el.find("thead th").removeClass("sort asc desc").eq(f).addClass("sort "+this.sortDirection),this.selectable&&f--,c.noReload?void 0:this.collection.setSort(this.sortColumn,this.sortDirection,null!=(e=this.columns[f])?e.sortAttribute:void 0)},h.prototype.setSearch=function(a){return this.collection.setSearch(a)},h.prototype.getRowCheckboxes=function(){return this.$el.find("td.checkbox input")},h.prototype.toggleSelectAll=function(){var a;return a=this.getRowCheckboxes(),this.ui.selectAllCheckbox.prop("checked")?(this.tableSelections.selectAllState=!0,this.tableSelections.deselectedIDs={},d.each(this.collection.models,function(a){return a.set("selected",!0)}),this.controller.carpenterRadio.trigger("table:rows:selected")):(this.tableSelections.selectAllState=!1,this.tableSelections.selectedIDs={},d.each(this.collection.models,function(a){return a.set("selected",!1)}),this.controller.carpenterRadio.trigger("table:rows:deselected")),this.collection.trigger("select_all_toggled"),!0},h.prototype.selectIntermediateCheckboxes=function(a){var b,d,e,f;return a.shiftKey&&this.previouslySelected&&(f=c(a.target).is(":checked"),b=c(a.target).parents("tr").prevAll(),e=c(a.target).parents("tr").nextAll(),d=c("tr").find(this.previouslySelected),b.has(d).length>0?c(a.target).parents("tr").prevUntil(c("tr").has(d)).find("td.checkbox input").prop("checked",f).change():e.has(d).length>0&&c(a.target).parents("tr").nextUntil(c("tr").has(d)).find("td.checkbox input").prop("checked",f).change()),this.previouslySelected=c(a.target)},h.prototype.handleRemoveMultiple=function(){return 0===this.collection.length?this.ui.selectAllCheckbox.prop("checked",!1):void 0},h.prototype.fetched=function(){return this.originalEmptyView?(this.emptyView=this.originalEmptyView,this.originalEmptyView=null,this.render()):this.updateClasses()},h.prototype.buildChildView=function(a,b){return new b({model:a,columns:this.columns,selectable:this.selectable,tableSelections:this.tableSelections,serverAPI:this.collection.server_api,controller:this.controller})},h.prototype.serializeData=function(){return this},h.prototype.updateClasses=function(){var a,b;return"function"==typeof(a=this.ui.table).toggleClass&&a.toggleClass("loaded",!0),"function"==typeof(b=this.ui.table).toggleClass?b.toggleClass("populated",!0):void 0},h.prototype.onRender=function(){return this.ui.table.resizableColumns(),this.updateClasses()},h}(e.CompositeView)}),h("templates/selection_indicator",[],function(){var a=function(a){var b=function(a){"undefined"==typeof a&&null==a&&(a="");var b=new String(a);return b.ecoSafe=!0,b};return function(){var a=[],c=this,d=function(b){"undefined"!=typeof b&&null!=b&&a.push(b.ecoSafe?b:c.escape(b))};return function(){d(b('
')),d(this.numSelected),d(b(" of ")),d(this.totalRecords),d(b(" selected
"))}.call(this),a.join("")}.call(function(){var c,d={escape:function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},safe:b};for(c in a)d[c]=a[c];return d}())};return a});var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty;h("views/selection_indicator",["templates/selection_indicator"],function(a){var b;return b=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}return i(c,b),c.prototype.template=a,c.prototype.initialize=function(a){var b,c;return null==a&&(a={}),this.tableSelections=a.tableSelections,this.tableCollection=a.tableCollection,b=["selection_toggled","select_all_toggled","remove:multiple:after"],d.each(b,function(a){return function(b){return a.listenTo(a.tableCollection,b,function(){return a.calculateNumSelected()})}}(this)),c=["sync","change:numSelected"],d.each(c,function(a){return function(b){return a.listenTo(a.tableCollection,b,function(){return a.render()})}}(this))},c.prototype.calculateNumSelected=function(){var a;return this.tableCollection.totalRecords?(a=this.tableSelections.selectAllState?this.tableCollection.totalRecords-Object.keys(this.tableSelections.deselectedIDs).length:Object.keys(this.tableSelections.selectedIDs).length,this.tableCollection.updateNumSelected(a)):0},c.prototype.serializeData=function(){return{numSelected:this.tableCollection.numSelected,totalRecords:this.tableCollection.totalRecords}},c}(e.ItemView)});var i=function(a,b){function c(){this.constructor=a}for(var d in b)j.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},j={}.hasOwnProperty,l=function(a,b){return function(){return a.apply(b,arguments)}};return h("controllers/table_controller",["controllers/application_controller","entities/paginated_collection","entities/action_buttons_collection","entities/action_button","entities/filter","views/control_bar","views/empty","views/header","views/layout","views/loading","views/paginator","views/row","views/row_list","views/selection_indicator","utilities/string_utils"],function(a,b,f,g,h,j,k,m,n,o,p,q,r,s,t){return e.Carpenter={},e.Carpenter.CellController=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return i(b,a),b}(a),e.Carpenter.Controller=function(a){function e(){return this.toggleInteraction=l(this.toggleInteraction,this),this.setPerPage=l(this.setPerPage,this),this.totalPages=l(this.totalPages,this),this.totalRecords=l(this.totalRecords,this),this.last=l(this.last,this),this.first=l(this.first,this),this.previous=l(this.previous,this),this.next=l(this.next,this),this.refresh=l(this.refresh,this),e.__super__.constructor.apply(this,arguments)}return i(e,a),e.prototype.showView=!0,e.prototype.selectable=!1,e.prototype.filterTemplatePath="",e.prototype.taggable=!1,e.prototype.title=null,e.prototype["static"]=!1,e.prototype.fetch=!0,e.prototype.defaultSort=null,e.prototype.actionButtons=[],e.prototype.columns=[],e.prototype.perPageOptions=[20,50,100,"All"],e.prototype.perPage=20,e.prototype.columnDefaults={sortable:!0,escape:!0,escapeLabel:!0,defaultDirection:"desc"},e.prototype.header=null,e.prototype.buttons=null,e.prototype.list=null,e.prototype.paginator=null,e.prototype.initialize=function(a){var c,e,g;return null==a&&(a={}),d.extend(this,a),d.each(this.columns,function(a){return function(b){return d.defaults(b,a.columnDefaults),d.defaults(b,{label:t.humanize(b.attribute)})}}(this)),this["static"]=!!this["static"],c=b(this.collection,this),this.collection=new c(this.collection.models),"function"==typeof(e=this.collection).rebind&&e.rebind(),this.setMainView(new n(this)),this.collection.perPage=this.perPage,this.collection.sortColumn=null!=(g=this.defaultSortColumn())?g.attribute:void 0,this.collection.sortDirection=this.defaultSortDirection(),this["static"]||this.collection.updateSortKey(),this.tableCollection=this.collection,this.tableSelections={},this.selectable&&(this.tableSelections.selectAllState=!1,this.tableSelections.selectedIDs={},this.tableSelections.deselectedIDs={}),this.actionButtonsCollection=new f(a.actionButtons),this.header=new m(this),this.buttons=new j(this),this.list=new r(this),this.paginator=new p(this),this.selectable&&(this.selectionIndicator=new s(this)),this.listenTo(this.collection,"reset",function(a){return function(){return a.toggleInteraction(!0)}}(this)),this.listenTo(this.collection,"sync",function(a){return function(){return a.toggleInteraction(!0)}}(this)),this.listenTo(this.collection,"change",function(a){return function(){return a.toggleInteraction(!0)}}(this)),this.listenTo(this.collection,"error",function(a){return function(){return a.toggleInteraction(!0)}}(this)),this.listenTo(this.collection,"remove:multiple",function(a){return function(b){return d.each(b,function(b){return delete a.tableSelections.selectedIDs[b]}),a.collection.trigger("remove:multiple:after"),a.toggleInteraction(!1),a.tableCollection.fetch()}}(this)),this.listenTo(this.getMainView(),"show",function(a){return function(){return a.show(a.header,{region:null!=a.headerRegion?a.headerRegion:a.getMainView().headerRegion}),a.show(a.buttons,{region:null!=a.buttonsRegion?a.buttonsRegion:a.getMainView().buttonsRegion}),a.show(a.list,{region:null!=a.tableRegion?a.tableRegion:a.getMainView().tableRegion}),a.show(a.paginator,{region:null!=a.paginationRegion?a.paginationRegion:a.getMainView().paginationRegion}),a.selectable&&a.show(a.selectionIndicator,{region:null!=a.selectionIndicatorRegion?a.selectionIndicatorRegion:a.getMainView().selectionIndicatorRegion,preventDestroy:!1}),"function"==typeof a.onShow?a.onShow(a):void 0}}(this)),this.listenTo(this.paginator,"table:first",this.first),this.listenTo(this.paginator,"table:previous",this.previous),this.listenTo(this.paginator,"table:next",this.next),this.listenTo(this.paginator,"table:last",this.last),this.listenTo(this.paginator,"table:setPerPage",function(a){return function(){var b,c;return c=a.paginator.ui.perPage.val(),a.perPage!==c?(b=c>a.perPage,a.setPerPage(c),b?a.toggleInteraction(!1):void 0):void 0}}(this)),this.listenTo(this.paginator,"table:pageInputChanged",d.debounce(function(a){return function(b){var c,e;if(e=parseInt(a.paginator.ui.pageInput.val()),null!=e&&d.isNumber(e)&&!d.isNaN(e)&&e!==a.collection.currentPage){if(c=Math.min(Math.max(1,e),a.totalPages()),c!==e&&a.paginator.ui.pageInput.val(c),c===a.collection.currentPage)return;return a.collection.goTo(c),a.toggleInteraction(!1),d.defer(function(){return a.paginator.ui.pageInput.click()})}}}(this),300)),this.listenTo(this.list,"table:sort",function(a){return function(b){var c,e;return null==b&&(b={}),e=d.findWhere(a.columns,{attribute:b.attribute}),c=a.list.sortColumn===b.attribute?"asc"===a.list.sortDirection?"desc":"asc":a.list.sortDirection||(null!=e?e.defaultDirection:void 0)||"desc",a.toggleInteraction(!1),(null!=e?e.sortable:void 0)?a.list.setSort(e.attribute,c,e.sortAttribute):void 0}}(this)),this["static"]?this.collection.bootstrap():this.fetch&&this.collection.fetch({reset:!0}),this.showView?this.show(this.getMainView(),{region:a.region}):void 0},e.prototype.refresh=function(a){return null==a&&(a={}),d.defaults(a,{reset:!0}),this.toggleInteraction(!1),this.collection.fetch(a)},e.prototype.next=function(){return this.toggleInteraction(!1),this.collection.nextPage()},e.prototype.previous=function(){return this.toggleInteraction(!1),this.collection.prevPage()},e.prototype.first=function(){return this.toggleInteraction(!1),this.collection.goTo(1)},e.prototype.last=function(){return this.toggleInteraction(!1),this.collection.goTo(this.totalPages())},e.prototype.totalRecords=function(){return null!=this.collection.totalRecords?this.collection.totalRecords:null!=this.collection.origModels?this.collection.origModels.length:null!=this.collection.models?this.collection.models.length:0},e.prototype.totalPages=function(){return this.totalRecords()%this.collection.perPage===0?Math.floor(this.totalRecords()/this.collection.perPage):Math.floor(this.totalRecords()/this.collection.perPage)+1},e.prototype.setPerPage=function(a){return this.paginator.perPage=this.perPage=a,this.collection.howManyPer(a)},e.prototype.defaultSortColumn=function(){return d.findWhere(this.columns,{attribute:this.defaultSort})||d.findWhere(this.columns,{sortable:!0})},e.prototype.defaultSortDirection=function(){var a,b;return a=null!=(b=this.defaultSortColumn())?b.defaultDirection:void 0,d.contains(["asc","desc"],a)&&a||"desc"},e.prototype.showColumn=function(a){return c("tr ."+a).show(),this.triggerMethod("show:column")},e.prototype.hideColumn=function(a){return c("tr ."+a).hide(),this.triggerMethod("hide:column")},e.prototype.toggleInteraction=function(a){var b,c;return a&&this.carpenterRadio.trigger("total_records:change",this.totalRecords()),this.isInteractionEnabled!==a?(this["static"]||(this.isInteractionEnabled=a,c="a,th,select,input",b=this.buttons.$el.find(c),this.getMainView().$el.find(c).not(b).toggleClass("disabled",!a),b.toggleClass("action-disabled",!a)),a?this.paginator.render():void 0):void 0},e}(a),e.Carpenter.create=function(a){var b;return null==a&&(a={}),a.showView=!1,b=new e.Carpenter.Controller(a),b.getMainView()},e.Carpenter.Controller}),g("controllers/table_controller")}); \ No newline at end of file diff --git a/package.json b/package.json index f1b95db..861cc4f 100644 --- a/package.json +++ b/package.json @@ -15,20 +15,21 @@ "url": "git://github.com/rapid7/marionette.carpenter.git" }, "devDependencies": { - "bower": "1.3.8", + "bower": "1.7.1", "grunt": "~0.4.5", "grunt-cli": "0.1.13", - "grunt-contrib-clean": "^0.6.0", - "grunt-contrib-coffee": "~0.11.0", - "grunt-sass": "^0.17.0", + "grunt-contrib-clean": "^0.7.0", + "grunt-contrib-coffee": "~0.13.0", "grunt-contrib-concat": "^0.5.0", - "grunt-contrib-copy": "^0.5.0", + "grunt-contrib-copy": "^0.8.0", "grunt-contrib-jasmine": "~0.5.0", + "grunt-contrib-uglify": "~0.11.0", "grunt-contrib-watch": "~0.6.1", "grunt-eco": "~0.1.2", - "grunt-requirejs": "~0.4.0", "grunt-image-embed": "~0.3.3", - "grunt-contrib-uglify": "~0.7.0" + "grunt-requirejs": "~0.4.0", + "grunt-sass": "^1.1.0", + "node-sass": "3.4.1" }, "license": "BSD-3-Clause" }