TimeTrex/interface/html5/dist/error_tip-ErrorTipBox.bundle.js

1 line
5.0 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["error_tip-ErrorTipBox"],{9876:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.ErrorTipBox = function( options ) {\n\t\tvar opts = $.extend( {}, $.fn.ErrorTipBox.defaults, options );\n\t\tvar $this = this;\n\t\tvar related_widget;\n\t\tvar timer;\n\n\t\tGlobal.addCss( 'global/widgets/error_tip/ErrorTipBox.css' );\n\n\t\tthis.cancelRemove = function() {\n\t\t\tif ( Global.isSet( timer ) ) {\n\t\t\t\tclearTimeout( timer );\n\t\t\t}\n\n\t\t};\n\n\t\tthis.show = function( target, error_string, sec, isWarning ) {\n\t\t\trelated_widget = target;\n\n\t\t\tif ( isWarning ) {\n\t\t\t\t$( this ).addClass( 'warningtip-box' );\n\t\t\t} else {\n\t\t\t\t$( this ).removeClass( 'warningtip-box' );\n\t\t\t}\n\n\t\t\tif ( $.type( error_string ) === 'array' ) {\n\t\t\t\terror_string = error_string.join( '<br>' );\n\t\t\t}\n\n\t\t\tvar error_tip_label = $( this ).find( '.errortip-label' );\n\t\t\terror_tip_label.html( error_string );\n\n\t\t\t$( this ).css( 'left', related_widget.offset().left + related_widget.width() + 5 );\n\n\t\t\tif ( related_widget.hasClass( 'a-combobox' ) ) {\n\t\t\t\t$( this ).css( 'top', related_widget.offset().top );\n\t\t\t} else {\n\t\t\t\t$( this ).css( 'top', related_widget.offset().top );\n\t\t\t}\n\n\t\t\t$( 'body' ).append( this );\n\n\t\t\tif ( sec > 0 ) {\n\t\t\t\ttimer = setTimeout( function() {\n\t\t\t\t\t$this.remove();\n\t\t\t\t}, sec * 1000 );\n\t\t\t}\n\t\t};\n\n\t\tthis.remove = function() {\n\t\t\t$( this ).remove();\n\t\t};\n\n\t\tthis.each( function() {\n\n\t\t\tvar o = $.meta ? $.extend( {}, opts, $( this ).data() ) : opts;\n\n\t\t} );\n\n\t\treturn this;\n\n\t};\n\n\t$.fn.ErrorTipBox.defaults = {};\n\t$.fn.ErrorTipBox.html_template = `\n\t<div class=\"errortip-box\">\n\t\t<span class=\"errortip-label\"></span>\n\t</div>\n\t`;\n\n} )( jQuery );//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTg3Ni5qcyIsIm1hcHBpbmdzIjoiO0FBQUE7O0FBRUE7QUFDQSx5QkFBeUI7QUFDekI7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLEtBQUs7QUFDTDtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUEsZ0NBQWdDOztBQUVoQyxJQUFJOztBQUVKOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSxFQUFFLEdBQUcsTUFBTSIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2ludGVyZmFjZS9odG1sNS9nbG9iYWwvd2lkZ2V0cy9lcnJvcl90aXAvRXJyb3JUaXBCb3guanM/ZDNmNSJdLCJzb3VyY2VzQ29udGVudCI6WyIoIGZ1bmN0aW9uKCAkICkge1xuXG5cdCQuZm4uRXJyb3JUaXBCb3ggPSBmdW5jdGlvbiggb3B0aW9ucyApIHtcblx0XHR2YXIgb3B0cyA9ICQuZXh0ZW5kKCB7fSwgJC5mbi5FcnJvclRpcEJveC5kZ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