From 7a62f297948a42eda99d886e93d7d91af2e0a43b Mon Sep 17 00:00:00 2001 From: manuelpiesold Date: Mon, 17 Nov 2014 14:53:36 +0100 Subject: [PATCH] change license-model, version increased --- LICENSE.md | 13 +++++++++++++ README.md | 21 ++------------------- dist/jquery.tableable.js | 4 ++-- dist/jquery.tableable.min.js | 4 ++-- tableable.jquery.json | 4 ++-- 5 files changed, 21 insertions(+), 25 deletions(-) create mode 100755 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100755 index 0000000..55b98d0 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,13 @@ +Copyright (c) 2014 guhberlin + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/README.md b/README.md index b184f6a..8d73a9b 100755 --- a/README.md +++ b/README.md @@ -80,25 +80,8 @@ Check [Releases](https://github.com/guhberlin/tableable/releases) for detailed c ## License -[MIT License](http://opensource.org/licenses/MIT) +[BSD-3-Clause](http://opensource.org/licenses/BSD-3-Clause) Copyright (c) 2014 guhberlin -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - +Please see [LICENSE.md](https://github.com/guhberlin/tableable/blob/master/LICENSE.md) for detailed information. diff --git a/dist/jquery.tableable.js b/dist/jquery.tableable.js index 3919095..bcc9074 100755 --- a/dist/jquery.tableable.js +++ b/dist/jquery.tableable.js @@ -1,10 +1,10 @@ /* - * jQuery tableable plugin - v1.4.2 + * jQuery tableable plugin - v2.0.0 * A plugin to filter, paginate and sort html tables * http://guhberlin.github.io/tableable * * Made by guhberlin - * Under MIT License + * Under BSD-3-Clause License */ function Filter ( element, options ) { diff --git a/dist/jquery.tableable.min.js b/dist/jquery.tableable.min.js index 4142cb9..c2c0819 100755 --- a/dist/jquery.tableable.min.js +++ b/dist/jquery.tableable.min.js @@ -1,9 +1,9 @@ /* - * jQuery tableable plugin - v1.4.2 + * jQuery tableable plugin - v2.0.0 * A plugin to filter, paginate and sort html tables * http://guhberlin.github.io/tableable * * Made by guhberlin - * Under MIT License + * Under BSD-3-Clause License */ function Filter(a,b){this.element=a,this.settings=b,this.afterFilter=function(){};var c=this;$(this.settings.filterInputSelector).keyup(function(){c.filter($(this).val()),c.afterFilter()})}function Sorter(a,b){this.element=a,this.settings=b,this.afterSort=function(){};var c=this;if($(c.element).children("thead").children("tr").children("th").each(function(){if(!c.settings.notSortableAttribute.length||!$(this).hasAttr(c.settings.notSortableAttribute)){var a=$(this).index()+1,b=c.settings.sortTriggerSelector.length?$(this).find(c.settings.sortTriggerSelector):$(this);b.on("click",function(){c.sortRows(a),c.afterSort()})}}),c.settings.notSortableAttribute.length){var d=$(c.element).find("thead tr th:nth-child("+c.settings.initalSortColIndex+")");d&&!d.hasAttr(c.settings.notSortableAttribute)&&c.sortRows(c.settings.initalSortColIndex)}}function Pager(a,b){this.element=a,this.settings=b,this.afterPaginate=function(){},this.pagerListBuildFunction="buildDottedPagerList",this.settings.useDottedPager||(this.pagerListBuildFunction="buildFullPagerList")}function Options(){}function TableAble(a,b){this.element=a;var c=new Options;this.settings=$.extend({},c.getDefaults(),b,c.getUneditableDefaults()),this.init()}Filter.prototype.setAfterFilterCallback=function(a){var b=this;$.isFunction(a)&&(b.afterFilter=a)},Filter.prototype.filter=function(a){var b=this;a=b.settings.ignoreCase?a.toLowerCase():a,$(b.element).children("tbody").children("tr").css("display","none").attr(b.settings.filteredAttribute,"").each(function(){var c=$(this);c.children("td").each(function(d,e){return b.settings.notFilterAttribute.length&&$(this).hasAttr(b.settings.notFilterAttribute)?void 0:(e=b.settings.ignoreCase?$(e).text().toLowerCase():$(e).text(),e.indexOf(a)>=0?void c.css("display",b.settings.displayType).removeAttr(b.settings.filteredAttribute):void 0)})})},Sorter.prototype.setAfterSortCallback=function(a){var b=this;$.isFunction(a)&&(b.afterSort=a)},Sorter.prototype.sortRows=function(a){var b=this,c=$(b.element).children("thead").children("tr").find(":nth-child("+a+")");c.hasAttr(b.settings.sortedAttribute)?"DESC"===c.attr(b.settings.sortedAttribute)?(b.sortAsc(a),c.attr(b.settings.sortedAttribute,"ASC")):(b.sortDesc(a),c.attr(b.settings.sortedAttribute,"DESC")):(c.parent().children("th").each(function(){$(this).removeAttr(b.settings.sortedAttribute)}),b.sortAsc(a),c.attr(b.settings.sortedAttribute,"ASC"))},Sorter.prototype.sortWithCallback=function(a){var b=this,c=$(b.element).children("tbody").children("tr");c.length&&($(b.element).children("tbody").empty(),c=c.sort(a),$(b.element).children("tbody").append(c))},Sorter.prototype.sortAsc=function(a){var b=this;b.sortWithCallback(function(b,c){return $(c).find(":nth-child("+a+")").text()<$(b).find(":nth-child("+a+")").text()})},Sorter.prototype.sortDesc=function(a){var b=this;b.sortWithCallback(function(b,c){return $(c).find(":nth-child("+a+")").text()>$(b).find(":nth-child("+a+")").text()})},Pager.prototype.setAfterPaginateCallback=function(a){var b=this;$.isFunction(a)&&(b.afterPaginate=a)},Pager.prototype.paginate=function(){var a=this,b=0;$(a.element).children("tbody").children("tr").removeAttr(a.settings.pageIndexAttribute).filter(function(){return!$(this).hasAttr(a.settings.filteredAttribute)}).each(function(c){c%a.settings.rowsPerPage===0&&b++,$(this).attr(a.settings.pageIndexAttribute,b)}),a.showPage(a.settings.currentPageIndex)},Pager.prototype.getPageCount=function(){var a=this;return Math.ceil($(a.element).children("tbody").children("tr").filter(function(){return!$(this).hasAttr(a.settings.filteredAttribute)}).length/a.settings.rowsPerPage)},Pager.prototype.buildPagerList=function(){var a=this;$(a.settings.pagerListSelector).empty(),a[a.pagerListBuildFunction](),$(a.settings.pagerListSelector+" li["+a.settings.pageSwitchPageAttribute+"]").on("click",function(){a.showPage($(this).attr(a.settings.pageSwitchPageAttribute))})},Pager.prototype.buildFullPagerList=function(){for(var a=this,b=a.getPageCount(),c=1;b>=c;c++)$(a.settings.pagerListSelector).append("
  • '+c+"
  • ")},Pager.prototype.buildDottedPagerList=function(){for(var a=this,b=parseInt(a.settings.currentPageIndex),c=a.getPageCount(),d=!1,e=1;c>=e;e++)1===e||2===e||e===b||e===b-1||e===b+1||e===c||e===c-1?($(a.settings.pagerListSelector).append("
  • '+e+"
  • "),d=!0):d&&($(a.settings.pagerListSelector).append("
  • ...
  • "),d=!1)},Pager.prototype.showPage=function(a){var b=this;$(b.element).children("tbody").children("tr").css("display","none").filter(function(){return $(this).attr(b.settings.pageIndexAttribute)===a}).css("display",b.settings.displayType),b.settings.currentPageIndex=a,b.buildPagerList(),$(b.settings.pagerListSelector+" li["+b.settings.pageSwitchPageAttribute+"]").removeClass("active").filter(function(){return $(this).attr(b.settings.pageSwitchPageAttribute)===a}).addClass("active"),b.afterPaginate()},Options.prototype.getDefaults=function(){return{useFilter:!0,filterInputSelector:"",ignoreCase:!1,notFilterAttribute:"data-no-filter",usePager:!0,useDottedPager:!0,pagerListSelector:"",rowsPerPage:5,useSorter:!0,sortTriggerSelector:"",jumpPageOneAfterSort:!0,notSortableAttribute:"data-no-sort",initalSortColIndex:-1}},Options.prototype.getUneditableDefaults=function(){return{displayType:"table-row",updatedEvent:"updated",filteredAttribute:"data-is-filtered",filteredEvent:"filtered",pageIndexAttribute:"data-page-index",pageSwitchPageAttribute:"data-show-page-index",currentPageIndex:"1",pagedEvent:"paged",pageChangedEvent:"pageChanged",sortedAttribute:"data-sort-by",sortedEvent:"sorted"}},TableAble.prototype.init=function(){var a=this,b=a.settings.usePager&&a.settings.pagerListSelector.length,c=a.settings.useFilter&&a.settings.filterInputSelector.length,d=a.settings.useSorter&&$(a.element).find("thead").length;b&&(a.pager=new Pager(a.element,a.settings),a.pager.setAfterPaginateCallback(function(){a.afterPaginate()})),c&&(a.filter=new Filter(a.element,a.settings),a.filter.setAfterFilterCallback(function(){a.afterFilter(b)})),d&&(a.sorter=new Sorter(a.element,a.settings),a.sorter.setAfterSortCallback(function(){a.afterSort(b)})),b&&a.pager.paginate()},TableAble.prototype.afterFilter=function(a){var b=this;a&&(b.settings.currentPageIndex="1",b.pager.paginate()),b.trigger(b.settings.filteredEvent)},TableAble.prototype.afterSort=function(a){var b=this;a&&(b.settings.jumpPageOneAfterSort&&(b.settings.currentPageIndex="1"),b.pager.paginate()),b.trigger(b.settings.sortedEvent)},TableAble.prototype.afterPaginate=function(){var a=this;a.trigger(a.settings.pageChangedEvent,!1)},TableAble.prototype.trigger=function(a,b){var c=this,d=void 0===b?!0:b;$(c.element).trigger(a),d&&$(c.element).trigger(c.settings.updatedEvent)},function(a,b,c,d){"use strict";a.fn.tableable=function(b){return this.each(function(){a.data(this,"plugin_tableable")||a.data(this,"plugin_tableable",new TableAble(this,b))}),this},a.fn.hasAttr=function(a){return this.attr(a)!==d}}(jQuery,window,document); \ No newline at end of file diff --git a/tableable.jquery.json b/tableable.jquery.json index 3acd34d..519ea98 100755 --- a/tableable.jquery.json +++ b/tableable.jquery.json @@ -10,7 +10,7 @@ "pager", "sorter" ], - "version": "1.4.2", + "version": "2.0.0", "author": { "name": "guhberlin", "url": "https://github.com/guhberlin" @@ -24,7 +24,7 @@ ], "licenses": [ { - "type": "MIT" + "type": "BSD-3-Clause" } ], "bugs": "https://github.com/guhberlin/tableable/issues",