smeserver-manager-jsquery/root/usr/share/javascript/StateRestore/js/dataTables.stateRestore.min.js

4 lines
42 KiB
JavaScript
Raw Normal View History

2024-12-17 17:18:29 +01:00
/*! StateRestore 1.4.1
2024-01-29 20:41:19 +01:00
* © SpryMedia Ltd - datatables.net/license
*/
2024-12-17 17:18:29 +01:00
!function(s){var o,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return s(e,window,document)}):"object"==typeof exports?(o=require("jquery"),i=function(e,t){t.fn.dataTable||require("datatables.net")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||o(e),i(e,t),s(t,0,e.document)}:(i(window,o),module.exports=s(o,window,window.document))):s(jQuery,window,document)}(function(y,e,g){"use strict";var u,m,p,a,k,s,t,c=y.fn.dataTable;function n(e,t,s,o,i,a){if(void 0===o&&(o=void 0),void 0===i&&(i=!1),void 0===a&&(a=function(){return null}),!m||!m.versionCheck||!m.versionCheck("1.10.0"))throw new Error("StateRestore requires DataTables 1.10 or newer");if(!m.Buttons)throw new Error("StateRestore requires Buttons");e=new m.Api(e);this.classes=u.extend(!0,{},n.classes),this.c=u.extend(!0,{},n.defaults,t),this.s={dt:e,identifier:s,isPreDefined:i,savedState:null,tableId:o&&o.stateRestore?o.stateRestore.tableId:void 0},this.dom={background:u('<div class="'+this.classes.background+'"/>'),closeButton:u('<div class="'+this.classes.closeButton+'">&times;</div>'),confirmation:u('<div class="'+this.classes.confirmation+'"/>'),confirmationButton:u('<button class="'+this.classes.confirmationButton+" "+this.classes.dtButton+'">'),confirmationTitleRow:u('<div class="'+this.classes.confirmationTitleRow+'"></div>'),dtContainer:u(this.s.dt.table().container()),duplicateError:u('<span class="'+this.classes.modalError+'">'+this.s.dt.i18n("stateRestore.duplicateError",this.c.i18n.duplicateError)+"</span>"),emptyError:u('<span class="'+this.classes.modalError+'">'+this.s.dt.i18n("stateRestore.emptyError",this.c.i18n.emptyError)+"</span>"),removeContents:u('<div class="'+this.classes.confirmationText+'"><span>'+this.s.dt.i18n("stateRestore.removeConfirm",this.c.i18n.removeConfirm).replace(/%s/g,n.entityEncode(this.s.identifier))+"</span></div>"),removeError:u('<span class="'+this.classes.modalError+'">'+this.s.dt.i18n("stateRestore.removeError",this.c.i18n.removeError)+"</span>"),removeTitle:u('<h2 class="'+this.classes.confirmationTitle+'">'+this.s.dt.i18n("stateRestore.removeTitle",this.c.i18n.removeTitle)+"</h2>"),renameContents:u('<div class="'+this.classes.confirmationText+" "+this.classes.renameModal+'"><label class="'+this.classes.confirmationMessage+'">'+this.s.dt.i18n("stateRestore.renameLabel",this.c.i18n.renameLabel).replace(/%s/g,n.entityEncode(this.s.identifier))+"</label></div>"),renameInput:u('<input class="'+this.classes.input+'" type="text"></input>'),renameTitle:u('<h2 class="'+this.classes.confirmationTitle+'">'+this.s.dt.i18n("stateRestore.renameTitle",this.c.i18n.renameTitle)+"</h2>")},this.save(o,a)}function r(e,t){var o=this;if(!a||!a.versionCheck||!a.versionCheck("1.10.0"))throw new Error("StateRestore requires DataTables 1.10 or newer");if(!a.Buttons)throw new Error("StateRestore requires Buttons");var s,i,e=new a.Api(e);if(this.classes=p.extend(!0,{},r.classes),void 0===e.settings()[0]._stateRestore)return this.c=p.extend(!0,{},r.defaults,t),this.s={dt:e,hasColReorder:void 0!==a.ColReorder,hasScroller:void 0!==a.Scroller,hasSearchBuilder:void 0!==a.SearchBuilder,hasSearchPanes:void 0!==a.SearchPanes,hasSelect:void 0!==a.select,states:[]},this.s.dt.on("xhr",function(e,t,s){s&&s.stateRestore&&o._addPreDefined(s.stateRestore)}),this.dom={background:p('<div class="'+this.classes.background+'"/>'),checkboxInputRow:p('<div class="'+this.classes.formRow+'"><label class="'+this.classes.nameLabel+'">'+this.s.dt.i18n("stateRestore.creationModal.toggleLabel",this.c.i18n.creationModal.toggleLabel)+'</label><div class="dtsr-input"></div></div>'),closeButton:p('<div class="'+this.classes.closeButton+'">x</div>'),colReorderToggle:p('<div class="'+this.classes.checkLabel+'"><input type="checkbox" class="'+this.classes.colReorderToggle+" "+this.classes.checkBox+'" checked>'+this.s.dt.i18n("stateRestore.creationModal.colReorder",this.c.i18n.creationModal.colReorder)+"</div>"),columnsSearchToggle:p('<div class="'+this.classes.checkLabel+'"><input type="checkbox" class="