From 7c72e1fa084657baa54e95c71fec4ca11b653790 Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sun, 16 Aug 2020 15:39:20 -0500 Subject: [PATCH] fix cookie issue with bootstrap-table --- web/css/bootstrap-table.min.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/css/bootstrap-table.min.css b/web/css/bootstrap-table.min.css index 00a219e7d..9a6eecda8 100644 --- a/web/css/bootstrap-table.min.css +++ b/web/css/bootstrap-table.min.css @@ -1,10 +1,11 @@ /** * bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation) * - * @version v1.17.1 + * @version v1.17.2 git e0f72f7 * @homepage https://bootstrap-table.com * @author wenzhixin (http://wenzhixin.net.cn/) * @license MIT */ -.bootstrap-table .fixed-table-toolbar::after{content:"";display:block;clear:both}.bootstrap-table .fixed-table-toolbar .bs-bars,.bootstrap-table .fixed-table-toolbar .columns,.bootstrap-table .fixed-table-toolbar .search{position:relative;margin-top:10px;margin-bottom:10px}.bootstrap-table .fixed-table-toolbar .columns .btn-group>.btn-group{display:inline-block;margin-left:-1px!important}.bootstrap-table .fixed-table-toolbar .columns .btn-group>.btn-group>.btn{border-radius:0}.bootstrap-table .fixed-table-toolbar .columns .btn-group>.btn-group:first-child>.btn{border-top-left-radius:4px;border-bottom-left-radius:4px}.bootstrap-table .fixed-table-toolbar .columns .btn-group>.btn-group:last-child>.btn{border-top-right-radius:4px;border-bottom-right-radius:4px}.bootstrap-table .fixed-table-toolbar .columns .dropdown-menu{text-align:left;max-height:300px;overflow:auto;-ms-overflow-style:scrollbar;z-index:1001}.bootstrap-table .fixed-table-toolbar .columns label{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.428571429}.bootstrap-table .fixed-table-toolbar .columns-left{margin-right:5px}.bootstrap-table .fixed-table-toolbar .columns-right{margin-left:5px}.bootstrap-table .fixed-table-toolbar .pull-right .dropdown-menu{right:0;left:auto}.bootstrap-table .fixed-table-container{position:relative;clear:both}.bootstrap-table .fixed-table-container .table{width:100%;margin-bottom:0!important}.bootstrap-table .fixed-table-container .table td,.bootstrap-table .fixed-table-container .table th{vertical-align:middle;box-sizing:border-box}.bootstrap-table .fixed-table-container .table thead th{vertical-align:bottom;padding:0;margin:0}.bootstrap-table .fixed-table-container .table thead th:focus{outline:0 solid transparent}.bootstrap-table .fixed-table-container .table thead th.detail{width:30px}.bootstrap-table .fixed-table-container .table thead th .th-inner{padding:.75rem;vertical-align:bottom;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bootstrap-table .fixed-table-container .table thead th .sortable{cursor:pointer;background-position:right;background-repeat:no-repeat;padding-right:30px!important}.bootstrap-table .fixed-table-container .table thead th .both{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC")}.bootstrap-table .fixed-table-container .table thead th .asc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==)}.bootstrap-table .fixed-table-container .table thead th .desc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII=)}.bootstrap-table .fixed-table-container .table tbody tr.selected td{background-color:rgba(0,0,0,.075)}.bootstrap-table .fixed-table-container .table tbody tr.no-records-found td{text-align:center}.bootstrap-table .fixed-table-container .table tbody tr .card-view{display:flex}.bootstrap-table .fixed-table-container .table tbody tr .card-view .card-view-title{font-weight:700;display:inline-block;min-width:30%;text-align:left!important}.bootstrap-table .fixed-table-container .table .bs-checkbox{text-align:center}.bootstrap-table .fixed-table-container .table .bs-checkbox label{margin-bottom:0}.bootstrap-table .fixed-table-container .table .bs-checkbox label input[type=checkbox],.bootstrap-table .fixed-table-container .table .bs-checkbox label input[type=radio]{margin:0 auto!important}.bootstrap-table .fixed-table-container .table.table-sm .th-inner{padding:.3rem}.bootstrap-table .fixed-table-container.fixed-height:not(.has-footer){border-bottom:1px solid #dee2e6}.bootstrap-table .fixed-table-container.fixed-height.has-card-view{border-top:1px solid #dee2e6;border-bottom:1px solid #dee2e6}.bootstrap-table .fixed-table-container.fixed-height .fixed-table-border{border-left:1px solid #dee2e6;border-right:1px solid #dee2e6}.bootstrap-table .fixed-table-container.fixed-height .table thead th{border-bottom:1px solid #dee2e6}.bootstrap-table .fixed-table-container.fixed-height .table-dark thead th{border-bottom:1px solid #32383e}.bootstrap-table .fixed-table-container .fixed-table-header{overflow:hidden}.bootstrap-table .fixed-table-container .fixed-table-body{overflow-x:auto;overflow-y:auto;height:100%}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading{align-items:center;background:#fff;display:none;justify-content:center;position:absolute;bottom:0;width:100%;z-index:1000}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap{align-items:baseline;display:flex;justify-content:center}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .loading-text{margin-right:6px}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-wrap{align-items:center;display:flex;justify-content:center}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-dot,.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-wrap::after,.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-wrap::before{content:"";animation-duration:1.5s;animation-iteration-count:infinite;animation-name:LOADING;background:#212529;border-radius:50%;display:block;height:5px;margin:0 4px;opacity:0;width:5px}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-dot{animation-delay:.3s}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading .loading-wrap .animation-wrap::after{animation-delay:.6s}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading.table-dark{background:#212529}.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading.table-dark .animation-dot,.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading.table-dark .animation-wrap::after,.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading.table-dark .animation-wrap::before{background:#fff}.bootstrap-table .fixed-table-container .fixed-table-footer{overflow:hidden}.bootstrap-table .fixed-table-pagination::after{content:"";display:block;clear:both}.bootstrap-table .fixed-table-pagination>.pagination,.bootstrap-table .fixed-table-pagination>.pagination-detail{margin-top:10px;margin-bottom:10px}.bootstrap-table .fixed-table-pagination>.pagination-detail .pagination-info{line-height:34px;margin-right:5px}.bootstrap-table .fixed-table-pagination>.pagination-detail .page-list{display:inline-block}.bootstrap-table .fixed-table-pagination>.pagination-detail .page-list .btn-group{position:relative;display:inline-block;vertical-align:middle}.bootstrap-table .fixed-table-pagination>.pagination-detail .page-list .btn-group .dropdown-menu{margin-bottom:0}.bootstrap-table .fixed-table-pagination>.pagination ul.pagination{margin:0}.bootstrap-table .fixed-table-pagination>.pagination ul.pagination a{padding:6px 12px;line-height:1.428571429}.bootstrap-table .fixed-table-pagination>.pagination ul.pagination li.page-intermediate a{color:#c8c8c8}.bootstrap-table .fixed-table-pagination>.pagination ul.pagination li.page-intermediate a::before{content:'\2B05'}.bootstrap-table .fixed-table-pagination>.pagination ul.pagination li.page-intermediate a::after{content:'\27A1'}.bootstrap-table .fixed-table-pagination>.pagination ul.pagination li.disabled a{pointer-events:none;cursor:default}.bootstrap-table.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%!important;background:#fff;height:calc(100vh);overflow-y:scroll}div.fixed-table-scroll-inner{width:100%;height:200px}div.fixed-table-scroll-outer{top:0;left:0;visibility:hidden;width:200px;height:150px;overflow:hidden}@keyframes LOADING{0%{opacity:0}50%{opacity:1}to{opacity:0}} \ No newline at end of file + +const Utils=$.fn.bootstrapTable.utils,UtilsCookie={cookieIds:{sortOrder:"bs.table.sortOrder",sortName:"bs.table.sortName",pageNumber:"bs.table.pageNumber",pageList:"bs.table.pageList",columns:"bs.table.columns",searchText:"bs.table.searchText",reorderColumns:"bs.table.reorderColumns",filterControl:"bs.table.filterControl",filterBy:"bs.table.filterBy"},getCurrentHeader(o){let e=o.$header;return o.options.height&&(e=o.$tableHeader),e},getCurrentSearchControls(o){let e="select, input";return o.options.height&&(e="table select, table input"),e},cookieEnabled:()=>!!navigator.cookieEnabled,inArrayCookiesEnabled(o,e){let t=-1;for(let i=0;i{const e=JSON.parse(UtilsCookie.getCookie(o,o.options.cookieIdTable,UtilsCookie.cookieIds.filterControl));if(!o.options.filterControlValuesLoaded&&e){const t={},i=UtilsCookie.getCurrentHeader(o),s=UtilsCookie.getCurrentSearchControls(o),r=(e,i)=>{i.forEach(i=>{if(""!==i.text&&("radio"!==e.type||e.value.toString()===i.text.toString()))if("INPUT"===e.tagName&&"radio"===e.type&&e.value.toString()===i.text.toString())e.checked=!0,t[i.field]=i.text;else if("INPUT"===e.tagName)e.value=i.text,t[i.field]=i.text;else if("SELECT"===e.tagName&&o.options.filterControlContainer)e.value=i.text,t[i.field]=i.text;else if(""!==i.text&&"SELECT"===e.tagName){for(let o=0;oe.field===o);r(this,t)}),o.initColumnSearch(t),o.options.filterControlValuesLoaded=!0,o.initServer()}},250)}};$.extend($.fn.bootstrapTable.defaults,{cookie:!1,cookieExpire:"2h",cookiePath:null,cookieDomain:null,cookieSecure:null,cookieIdTable:"",cookiesEnabled:["bs.table.sortOrder","bs.table.sortName","bs.table.pageNumber","bs.table.pageList","bs.table.columns","bs.table.searchText","bs.table.filterControl","bs.table.filterBy","bs.table.reorderColumns"],cookieStorage:"cookieStorage",cookieCustomStorageGet:null,cookieCustomStorageSet:null,cookieCustomStorageDelete:null,filterControls:[],filterControlValuesLoaded:!1}),$.fn.bootstrapTable.methods.push("getCookies"),$.fn.bootstrapTable.methods.push("deleteCookie"),$.extend($.fn.bootstrapTable.utils,{setCookie:UtilsCookie.setCookie,getCookie:UtilsCookie.getCookie}),$.BootstrapTable=class extends $.BootstrapTable{init(){if(this.options.cookie){const o=UtilsCookie.getCookie(this,this.options.cookieIdTable,UtilsCookie.cookieIds.filterBy);if("boolean"==typeof o&&!o)throw new Error("The cookie value of filterBy must be a json!");let e={};try{e=JSON.parse(o)}catch(o){throw new Error("Could not parse the json of the filterBy cookie!")}if(this.filterColumns=e||{},this.options.filterControls=[],this.options.filterControlValuesLoaded=!1,this.options.cookiesEnabled="string"==typeof this.options.cookiesEnabled?this.options.cookiesEnabled.replace("[","").replace("]","").replace(/'/g,"").replace(/ /g,"").toLowerCase().split(","):this.options.cookiesEnabled,this.options.filterControl){const o=this;this.$el.on("column-search.bs.table",(e,t,i)=>{let s=!0;for(let e=0;eo.field)))}_toggleAllColumns(...o){super._toggleAllColumns(...o),UtilsCookie.setCookie(this,UtilsCookie.cookieIds.columns,JSON.stringify(this.getVisibleColumns().map(o=>o.field)))}selectPage(o){super.selectPage(o),UtilsCookie.setCookie(this,UtilsCookie.cookieIds.pageNumber,o)}onSearch(o){super.onSearch(o),this.options.search&&UtilsCookie.setCookie(this,UtilsCookie.cookieIds.searchText,this.searchText),UtilsCookie.setCookie(this,UtilsCookie.cookieIds.pageNumber,this.options.pageNumber)}initHeader(...o){this.options.reorderableColumns&&(this.columnsSortOrder=JSON.parse(UtilsCookie.getCookie(this,this.options.cookieIdTable,UtilsCookie.cookieIds.reorderColumns))),super.initHeader(...o)}persistReorderColumnsState(o){UtilsCookie.setCookie(o,UtilsCookie.cookieIds.reorderColumns,JSON.stringify(o.columnsSortOrder))}filterBy(...o){super.filterBy(...o),UtilsCookie.setCookie(this,UtilsCookie.cookieIds.filterBy,JSON.stringify(this.filterColumns))}initCookie(){if(!this.options.cookie)return;if(""===this.options.cookieIdTable||""===this.options.cookieExpire||!UtilsCookie.cookieEnabled())return console.error("Configuration error. Please review the cookieIdTable and the cookieExpire property. If the properties are correct, then this browser does not support cookies."),void(this.options.cookie=!1);const o=UtilsCookie.getCookie(this,this.options.cookieIdTable,UtilsCookie.cookieIds.sortOrder),e=UtilsCookie.getCookie(this,this.options.cookieIdTable,UtilsCookie.cookieIds.sortName),t=UtilsCookie.getCookie(this,this.options.cookieIdTable,UtilsCookie.cookieIds.pageNumber),i=UtilsCookie.getCookie(this,this.options.cookieIdTable,UtilsCookie.cookieIds.pageList),s=UtilsCookie.getCookie(this,this.options.cookieIdTable,UtilsCookie.cookieIds.searchText),r=UtilsCookie.getCookie(this,this.options.cookieIdTable,UtilsCookie.cookieIds.columns);if("boolean"==typeof r&&!r)throw new Error("The cookie value of filterBy must be a json!");let l={};try{l=JSON.parse(r)}catch(o){throw new Error("Could not parse the json of the columns cookie!",r)}if(this.options.sortOrder=o||this.options.sortOrder,this.options.sortName=e||this.options.sortName,this.options.pageNumber=t?+t:this.options.pageNumber,this.options.pageSize=i?i===this.options.formatAllRows()?i:+i:this.options.pageSize,this.options.searchText=s||"",l)for(const o of this.columns)o.visible=l.filter(e=>e instanceof Object?e.field===o.field:e===o.field).length>0||!o.switchable}getCookies(){const o=this,e={};return $.each(UtilsCookie.cookieIds,(t,i)=>{e[t]=UtilsCookie.getCookie(o,o.options.cookieIdTable,i),"columns"===t&&(e[t]=JSON.parse(e[t]))}),e}deleteCookie(o){""!==o&&UtilsCookie.cookieEnabled()&&UtilsCookie.deleteCookie(this,this.options.cookieIdTable,UtilsCookie.cookieIds[o])}};