Ui-theme: remove bootstrap v2 refs & fix docs. See #1432

This commit is contained in:
Rob Garrison 2017-07-19 14:20:01 -05:00
parent 95be0ce9cd
commit c800b67b6f
10 changed files with 26 additions and 25 deletions

View File

@ -3010,10 +3010,10 @@
active : '', // applied when column is sorted active : '', // applied when column is sorted
hover : '', // custom css required - a defined bootstrap style may not override other classes hover : '', // custom css required - a defined bootstrap style may not override other classes
// icon class names // icon class names
icons : '', // add 'icon-white' to make them white; this icon class is added to the <i> in the header icons : '', // add 'bootstrap-icon-white' to make them white; this icon class is added to the <i> in the header
iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted
iconSortAsc : 'icon-chevron-up glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort iconSortAsc : 'glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort
iconSortDesc : 'icon-chevron-down glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort iconSortDesc : 'glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort
filterRow : '', // filter row class filterRow : '', // filter row class
footerRow : '', footerRow : '',
footerCells : '', footerCells : '',

File diff suppressed because one or more lines are too long

View File

@ -144,10 +144,10 @@
active : '', // applied when column is sorted active : '', // applied when column is sorted
hover : '', // custom css required - a defined bootstrap style may not override other classes hover : '', // custom css required - a defined bootstrap style may not override other classes
// icon class names // icon class names
icons : '', // add 'icon-white' to make them white; this icon class is added to the <i> in the header icons : '', // add 'bootstrap-icon-white' to make them white; this icon class is added to the <i> in the header
iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted
iconSortAsc : 'icon-chevron-up glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort iconSortAsc : 'glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort
iconSortDesc : 'icon-chevron-down glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort iconSortDesc : 'glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort
filterRow : '', // filter row class filterRow : '', // filter row class
footerRow : '', footerRow : '',
footerCells : '', footerCells : '',

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
/*! Widget: uitheme - updated 12/8/2016 (v2.28.1) */ /*! Widget: uitheme - updated 12/8/2016 (v2.28.1) */
!function(e){"use strict";var o=e.tablesorter||{};o.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"icon-chevron-up glyphicon glyphicon-chevron-up",iconSortDesc:"icon-chevron-down glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",caption:"ui-widget-content",header:"ui-widget-header ui-corner-all ui-state-default",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s ui-icon-caret-2-n-s",iconSortAsc:"ui-icon-carat-1-n ui-icon-caret-1-n",iconSortDesc:"ui-icon-carat-1-s ui-icon-caret-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},e.extend(o.css,{wrapper:"tablesorter-wrapper"}),o.addWidget({id:"uitheme",priority:10,format:function(t,s,r){var i,a,n,c,l,d,h,m,u,p,v,f,b,C=o.themes,w=s.$table.add(e(s.namespace+"_extra_table")),g=s.$headers.add(e(s.namespace+"_extra_headers")),S=s.theme||"jui",j=C[S]||{},D=e.trim([j.sortNone,j.sortDesc,j.sortAsc,j.active].join(" ")),A=e.trim([j.iconSortNone,j.iconSortDesc,j.iconSortAsc].join(" "));for(s.debug&&(l=new Date),w.hasClass("tablesorter-"+S)&&s.theme===s.appliedTheme&&r.uitheme_applied||(r.uitheme_applied=!0,p=C[s.appliedTheme]||{},v=(b=!e.isEmptyObject(p))?[p.sortNone,p.sortDesc,p.sortAsc,p.active].join(" "):"",f=b?[p.iconSortNone,p.iconSortDesc,p.iconSortAsc].join(" "):"",b&&(r.zebra[0]=e.trim(" "+r.zebra[0].replace(" "+p.even,"")),r.zebra[1]=e.trim(" "+r.zebra[1].replace(" "+p.odd,"")),s.$tbodies.children().removeClass([p.even,p.odd].join(" "))),j.even&&(r.zebra[0]+=" "+j.even),j.odd&&(r.zebra[1]+=" "+j.odd),w.children("caption").removeClass(p.caption||"").addClass(j.caption),m=w.removeClass((s.appliedTheme?"tablesorter-"+(s.appliedTheme||""):"")+" "+(p.table||"")).addClass("tablesorter-"+S+" "+(j.table||"")).children("tfoot"),s.appliedTheme=s.theme,m.length&&m.children("tr").removeClass(p.footerRow||"").addClass(j.footerRow).children("th, td").removeClass(p.footerCells||"").addClass(j.footerCells),g.removeClass((b?[p.header,p.hover,v].join(" "):"")||"").addClass(j.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(o){e(this)["mouseenter"===o.type?"addClass":"removeClass"](j.hover||"")}),g.each(function(){var t=e(this);t.find("."+o.css.wrapper).length||t.wrapInner('<div class="'+o.css.wrapper+'" style="position:relative;height:100%;width:100%"></div>')}),s.cssIcon&&g.find("."+o.css.icon).removeClass(b?[p.icons,f].join(" "):"").addClass(j.icons||""),o.hasWidget(s.table,"filter")&&(a=function(){w.children("thead").children("."+o.css.filterRow).removeClass(b?p.filterRow||"":"").addClass(j.filterRow||"")},r.filter_initialized?a():w.one("filterInit",function(){a()}))),i=0;i<s.columns;i++)d=s.$headers.add(e(s.namespace+"_extra_headers")).not(".sorter-false").filter('[data-column="'+i+'"]'),h=o.css.icon?d.find("."+o.css.icon):e(),(u=g.not(".sorter-false").filter('[data-column="'+i+'"]:last')).length&&(d.removeClass(D),h.removeClass(A),u[0].sortDisabled?h.removeClass(j.icons||""):(n=j.sortNone,c=j.iconSortNone,u.hasClass(o.css.sortAsc)?(n=[j.sortAsc,j.active].join(" "),c=j.iconSortAsc):u.hasClass(o.css.sortDesc)&&(n=[j.sortDesc,j.active].join(" "),c=j.iconSortDesc),d.addClass(n),h.addClass(c||"")));s.debug&&console.log("Applying "+S+" theme"+o.benchmark(l))},remove:function(e,t,s,r){if(s.uitheme_applied){var i=t.$table,a=t.appliedTheme||"jui",n=o.themes[a]||o.themes.jui,c=i.children("thead").children(),l=n.sortNone+" "+n.sortDesc+" "+n.sortAsc,d=n.iconSortNone+" "+n.iconSortDesc+" "+n.iconSortAsc;i.removeClass("tablesorter-"+a+" "+n.table),s.uitheme_applied=!1,r||(i.find(o.css.header).removeClass(n.header),c.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(n.hover+" "+l+" "+n.active).filter("."+o.css.filterRow).removeClass(n.filterRow),c.find("."+o.css.icon).removeClass(n.icons+" "+d))}}})}(jQuery); !function(e){"use strict";var o=e.tablesorter||{};o.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"glyphicon glyphicon-chevron-up",iconSortDesc:"glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",caption:"ui-widget-content",header:"ui-widget-header ui-corner-all ui-state-default",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s ui-icon-caret-2-n-s",iconSortAsc:"ui-icon-carat-1-n ui-icon-caret-1-n",iconSortDesc:"ui-icon-carat-1-s ui-icon-caret-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},e.extend(o.css,{wrapper:"tablesorter-wrapper"}),o.addWidget({id:"uitheme",priority:10,format:function(t,s,r){var i,a,n,c,l,d,h,m,u,p,v,f,b,C=o.themes,w=s.$table.add(e(s.namespace+"_extra_table")),g=s.$headers.add(e(s.namespace+"_extra_headers")),S=s.theme||"jui",j=C[S]||{},D=e.trim([j.sortNone,j.sortDesc,j.sortAsc,j.active].join(" ")),A=e.trim([j.iconSortNone,j.iconSortDesc,j.iconSortAsc].join(" "));for(s.debug&&(l=new Date),w.hasClass("tablesorter-"+S)&&s.theme===s.appliedTheme&&r.uitheme_applied||(r.uitheme_applied=!0,p=C[s.appliedTheme]||{},v=(b=!e.isEmptyObject(p))?[p.sortNone,p.sortDesc,p.sortAsc,p.active].join(" "):"",f=b?[p.iconSortNone,p.iconSortDesc,p.iconSortAsc].join(" "):"",b&&(r.zebra[0]=e.trim(" "+r.zebra[0].replace(" "+p.even,"")),r.zebra[1]=e.trim(" "+r.zebra[1].replace(" "+p.odd,"")),s.$tbodies.children().removeClass([p.even,p.odd].join(" "))),j.even&&(r.zebra[0]+=" "+j.even),j.odd&&(r.zebra[1]+=" "+j.odd),w.children("caption").removeClass(p.caption||"").addClass(j.caption),m=w.removeClass((s.appliedTheme?"tablesorter-"+(s.appliedTheme||""):"")+" "+(p.table||"")).addClass("tablesorter-"+S+" "+(j.table||"")).children("tfoot"),s.appliedTheme=s.theme,m.length&&m.children("tr").removeClass(p.footerRow||"").addClass(j.footerRow).children("th, td").removeClass(p.footerCells||"").addClass(j.footerCells),g.removeClass((b?[p.header,p.hover,v].join(" "):"")||"").addClass(j.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(o){e(this)["mouseenter"===o.type?"addClass":"removeClass"](j.hover||"")}),g.each(function(){var t=e(this);t.find("."+o.css.wrapper).length||t.wrapInner('<div class="'+o.css.wrapper+'" style="position:relative;height:100%;width:100%"></div>')}),s.cssIcon&&g.find("."+o.css.icon).removeClass(b?[p.icons,f].join(" "):"").addClass(j.icons||""),o.hasWidget(s.table,"filter")&&(a=function(){w.children("thead").children("."+o.css.filterRow).removeClass(b?p.filterRow||"":"").addClass(j.filterRow||"")},r.filter_initialized?a():w.one("filterInit",function(){a()}))),i=0;i<s.columns;i++)d=s.$headers.add(e(s.namespace+"_extra_headers")).not(".sorter-false").filter('[data-column="'+i+'"]'),h=o.css.icon?d.find("."+o.css.icon):e(),(u=g.not(".sorter-false").filter('[data-column="'+i+'"]:last')).length&&(d.removeClass(D),h.removeClass(A),u[0].sortDisabled?h.removeClass(j.icons||""):(n=j.sortNone,c=j.iconSortNone,u.hasClass(o.css.sortAsc)?(n=[j.sortAsc,j.active].join(" "),c=j.iconSortAsc):u.hasClass(o.css.sortDesc)&&(n=[j.sortDesc,j.active].join(" "),c=j.iconSortDesc),d.addClass(n),h.addClass(c||"")));s.debug&&console.log("Applying "+S+" theme"+o.benchmark(l))},remove:function(e,t,s,r){if(s.uitheme_applied){var i=t.$table,a=t.appliedTheme||"jui",n=o.themes[a]||o.themes.jui,c=i.children("thead").children(),l=n.sortNone+" "+n.sortDesc+" "+n.sortAsc,d=n.iconSortNone+" "+n.iconSortDesc+" "+n.iconSortAsc;i.removeClass("tablesorter-"+a+" "+n.table),s.uitheme_applied=!1,r||(i.find(o.css.header).removeClass(n.header),c.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(n.hover+" "+l+" "+n.active).filter("."+o.css.filterRow).removeClass(n.filterRow),c.find("."+o.css.icon).removeClass(n.icons+" "+d))}}})}(jQuery);

View File

@ -40,7 +40,7 @@
active : '', // applied when column is sorted active : '', // applied when column is sorted
hover : '', // custom css required - a defined bootstrap style may not override other classes hover : '', // custom css required - a defined bootstrap style may not override other classes
// icon class names // icon class names
icons : '', // add "icon-white" to make them white; this icon class is added to the <i> in the header icons : '', // add "bootstrap-icon-white" to make them white; this icon class is added to the <i> in the header
iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted
iconSortAsc : 'glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort iconSortAsc : 'glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort
iconSortDesc : 'glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort iconSortDesc : 'glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort
@ -131,7 +131,7 @@
$(this) $(this)
.toggleClass('btn-danger btn-success') .toggleClass('btn-danger btn-success')
.find('i') .find('i')
.toggleClass('icon-ok icon-remove glyphicon-ok glyphicon-remove').end() .toggleClass('glyphicon-ok glyphicon-remove').end()
.find('span') .find('span')
.text(t ? 'disabled' : 'enabled'); .text(t ? 'disabled' : 'enabled');
$('table').trigger('refreshWidgets', [false]); $('table').trigger('refreshWidgets', [false]);
@ -192,8 +192,8 @@
<li>This demo shows how to get around an issue with the filter widget: <li>This demo shows how to get around an issue with the filter widget:
<ul> <ul>
<li>The <span class="label label-info">zebra widget button</span> below was added to show that when bootstrap's "table-striped" class is applied, the css defined zebra striping will not apply correctly because table rows are hidden but still accounted for by the css <code>nth-child()</code> selector.</li> <li>The <span class="label label-info">zebra widget button</span> below was added to show that when bootstrap's "table-striped" class is applied, the css defined zebra striping will not apply correctly because table rows are hidden but still accounted for by the css <code>nth-child()</code> selector.</li>
<li>To better understand this issue, disable the zebra widget (using the toggle button). Now <button type="button" class="filter btn btn-sm btn-primary" data-column="5" data-filter=">80"><i class="icon-white icon-filter glyphicon glyphicon-filter"></i> Filter ">80"</button> in the "Calculus" column.</li> <li>To better understand this issue, disable the zebra widget (using the toggle button). Now <button type="button" class="filter btn btn-sm btn-primary" data-column="5" data-filter=">80"><i class="bootstrap-icon-white glyphicon glyphicon-filter"></i> Filter ">80"</button> in the "Calculus" column.</li>
<li>Try other filter searches with the zebra widget disabled, like <button type="button" class="filter btn btn-sm btn-primary" data-column="2" data-filter="male"><i class="icon-white icon-filter glyphicon glyphicon-filter"></i> Filter "male"</button> in the "Sex" column.</li> <li>Try other filter searches with the zebra widget disabled, like <button type="button" class="filter btn btn-sm btn-primary" data-column="2" data-filter="male"><i class="bootstrap-icon-white glyphicon glyphicon-filter"></i> Filter "male"</button> in the "Sex" column.</li>
<li>To solve this issue, just enable the zebra widget and the "even" and "odd" row class names <del>will</del> should over-ride the <code>nth-child()</code> styling.<br><span class="label label-warning">NOTE!</span> This doesn't seem to work in the latest Bootstrap version, so you'll have to remove the "table-striped" class completely from the table.</li> <li>To solve this issue, just enable the zebra widget and the "even" and "odd" row class names <del>will</del> should over-ride the <code>nth-child()</code> styling.<br><span class="label label-warning">NOTE!</span> This doesn't seem to work in the latest Bootstrap version, so you'll have to remove the "table-striped" class completely from the table.</li>
<li>The only down side is that for custom bootstrap themes, you'll need to edit the "theme.bootstrap.css" file for bootstrap.</li> <li>The only down side is that for custom bootstrap themes, you'll need to edit the "theme.bootstrap.css" file for bootstrap.</li>
</ul> </ul>
@ -204,9 +204,9 @@
<h1>Demo</h1> <h1>Demo</h1>
<!-- use the filter_reset : '.reset' option or include data-filter="" using the filter button demo code to reset the filters --> <!-- use the filter_reset : '.reset' option or include data-filter="" using the filter button demo code to reset the filters -->
<div class="bootstrap_buttons"> <div class="bootstrap_buttons">
Reset filter : <button type="button" class="reset btn btn-primary" data-column="0" data-filter=""><i class="icon-white icon-refresh glyphicon glyphicon-refresh"></i> Reset filters</button> Reset filter : <button type="button" class="reset btn btn-primary" data-column="0" data-filter=""><i class="bootstrap-icon-white glyphicon glyphicon-refresh"></i> Reset filters</button>
<br> <br>
Zebra widget : <button type="button" class="zebra btn btn-success"><i class="icon-white icon-ok glyphicon glyphicon-ok"></i> <span>enabled</span></button> Zebra widget : <button type="button" class="zebra btn btn-success"><i class="bootstrap-icon-white glyphicon glyphicon-ok"></i> <span>enabled</span></button>
</div> </div>
<br> <br>

View File

@ -3016,10 +3016,10 @@
active : '', // applied when column is sorted active : '', // applied when column is sorted
hover : '', // custom css required - a defined bootstrap style may not override other classes hover : '', // custom css required - a defined bootstrap style may not override other classes
// icon class names // icon class names
icons : '', // add 'icon-white' to make them white; this icon class is added to the <i> in the header icons : '', // add 'bootstrap-icon-white' to make them white; this icon class is added to the <i> in the header
iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted
iconSortAsc : 'icon-chevron-up glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort iconSortAsc : 'glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort
iconSortDesc : 'icon-chevron-down glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort iconSortDesc : 'glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort
filterRow : '', // filter row class filterRow : '', // filter row class
footerRow : '', footerRow : '',
footerCells : '', footerCells : '',

View File

@ -150,10 +150,10 @@
active : '', // applied when column is sorted active : '', // applied when column is sorted
hover : '', // custom css required - a defined bootstrap style may not override other classes hover : '', // custom css required - a defined bootstrap style may not override other classes
// icon class names // icon class names
icons : '', // add 'icon-white' to make them white; this icon class is added to the <i> in the header icons : '', // add 'bootstrap-icon-white' to make them white; this icon class is added to the <i> in the header
iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted
iconSortAsc : 'icon-chevron-up glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort iconSortAsc : 'glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort
iconSortDesc : 'icon-chevron-down glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort iconSortDesc : 'glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort
filterRow : '', // filter row class filterRow : '', // filter row class
footerRow : '', footerRow : '',
footerCells : '', footerCells : '',

View File

@ -213,8 +213,9 @@
mydata = outputArray && hasStringify ? JSON.stringify(tmpData) : tmpData.join('\n'); mydata = outputArray && hasStringify ? JSON.stringify(tmpData) : tmpData.join('\n');
} }
if (dump) if (dump) {
return mydata; return mydata;
}
// callback; if true returned, continue processing // callback; if true returned, continue processing
if ($.isFunction(wo.output_callback)) { if ($.isFunction(wo.output_callback)) {

View File

@ -15,10 +15,10 @@
active : '', // applied when column is sorted active : '', // applied when column is sorted
hover : '', // custom css required - a defined bootstrap style may not override other classes hover : '', // custom css required - a defined bootstrap style may not override other classes
// icon class names // icon class names
icons : '', // add 'icon-white' to make them white; this icon class is added to the <i> in the header icons : '', // add 'bootstrap-icon-white' to make them white; this icon class is added to the <i> in the header
iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted
iconSortAsc : 'icon-chevron-up glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort iconSortAsc : 'glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort
iconSortDesc : 'icon-chevron-down glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort iconSortDesc : 'glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort
filterRow : '', // filter row class filterRow : '', // filter row class
footerRow : '', footerRow : '',
footerCells : '', footerCells : '',