Files
everything2/EveryThing/wwwroot/vendor/libs/bootstrap-table/extensions/auto-refresh/auto-refresh.js
David Štaleker 03b92525d7 Prvi commit
2023-05-12 09:00:07 +02:00

1 line
4.9 KiB
JavaScript

!function(t,e){var o=function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=393)}({393:function(t,e,o){o(394)},394:function(t,e){function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function i(t,e,o){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,o){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););return t}(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(o):r.value}})(t,e,o||t)}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var a,f;a=jQuery,f=a.fn.bootstrapTable.utils,a.extend(a.fn.bootstrapTable.defaults,{autoRefresh:!1,autoRefreshInterval:60,autoRefreshSilent:!0,autoRefreshStatus:!0,autoRefreshFunction:null}),a.extend(a.fn.bootstrapTable.defaults.icons,{autoRefresh:4===f.bootstrapVersion?"fa-clock":"glyphicon-time icon-time"}),a.extend(a.fn.bootstrapTable.locales,{formatAutoRefresh:function(){return"Auto Refresh"}}),a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales),a.BootstrapTable=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r(this,s(e).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(e,t),o=e,(l=[{key:"init",value:function(){for(var t,o=this,n=arguments.length,r=new Array(n),u=0;u<n;u++)r[u]=arguments[u];(t=i(s(e.prototype),"init",this)).call.apply(t,[this].concat(r)),this.options.autoRefresh&&this.options.autoRefreshStatus&&(this.options.autoRefreshFunction=setInterval(function(){o.refresh({silent:o.options.autoRefreshSilent})},1e3*this.options.autoRefreshInterval))}},{key:"initToolbar",value:function(){for(var t,o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];if((t=i(s(e.prototype),"initToolbar",this)).call.apply(t,[this].concat(n)),this.options.autoRefresh){var u=this.$toolbar.find(">.btn-group"),l=u.find(".auto-refresh");l.length||(l=a('\n <button class="auto-refresh btn'.concat(f.sprintf(" btn-%s",this.options.buttonsClass),"\n ").concat(f.sprintf(" btn-%s",this.options.iconSize),"\n ").concat(this.options.autoRefreshStatus?"active":"",'"\n type="button" title="').concat(this.options.formatAutoRefresh(),'">\n <i class="').concat(this.options.iconsPrefix," ").concat(this.options.icons.autoRefresh,'"></i>\n </button>\n ')).appendTo(u)).on("click",a.proxy(this.toggleAutoRefresh,this))}}},{key:"toggleAutoRefresh",value:function(){var t=this;this.options.autoRefresh&&(this.options.autoRefreshStatus?(clearInterval(this.options.autoRefreshFunction),this.$toolbar.find(">.btn-group").find(".auto-refresh").removeClass("active")):(this.options.autoRefreshFunction=setInterval(function(){t.refresh({silent:t.options.autoRefreshSilent})},1e3*this.options.autoRefreshInterval),this.$toolbar.find(">.btn-group").find(".auto-refresh").addClass("active")),this.options.autoRefreshStatus=!this.options.autoRefreshStatus)}}])&&n(o.prototype,l),c&&n(o,c),e;var o,l,c}(a.BootstrapTable)}});if("object"==typeof o){var n=["object"==typeof module&&"object"==typeof module.exports?module.exports:null,"undefined"!=typeof window?window:null,t&&t!==window?t:null];for(var r in o)n[0]&&(n[0][r]=o[r]),n[1]&&"__esModule"!==r&&(n[1][r]=o[r]),n[2]&&(n[2][r]=o[r])}}(this);