mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added a new library to support on screen notification messages
This commit is contained in:
@@ -5,4 +5,4 @@ imports:
|
||||
|
||||
# please keep the excluded paths list sorted
|
||||
filter:
|
||||
excluded_paths: [ html/includes/geshi/*, html/includes/jpgraph/*, html/js/bootstrap*, html/js/jqplot/*, html/js/jquery.cycle*, html/js/jquery-ui-timepicker-addon.js, html/js/sorttable.js, html/js/tw-sack.js, includes/phpmailer/*, html/css/bootstrap*, html/includes/Slim/* ]
|
||||
excluded_paths: [ html/includes/geshi/*, html/includes/jpgraph/*, html/js/bootstrap*, html/js/jqplot/*, html/js/jquery.cycle*, html/js/jquery-ui-timepicker-addon.js, html/js/sorttable.js, html/js/tw-sack.js, includes/phpmailer/*, html/css/bootstrap*, html/includes/Slim/*, html/css/toastr*, html/js/toastr* ]
|
||||
|
||||
1
html/css/toastr.min.css
vendored
Normal file
1
html/css/toastr.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -130,6 +130,7 @@ if ($config['page_refresh']) { echo(' <meta http-equiv="refresh" content="'.$co
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="css/typeahead.js-bootstrap.css" rel="stylesheet" type="text/css" />
|
||||
<link href="css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="css/toastr.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?php echo($config['stylesheet']); ?>" rel="stylesheet" type="text/css" />
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/bootstrap.min.js"></script>
|
||||
@@ -153,6 +154,7 @@ if ($config['favicon']) { echo(' <link rel="shortcut icon" href="'.$config['fav
|
||||
// End -->
|
||||
</script>
|
||||
<script type="text/javascript" src="js/overlib_mini.js"></script>
|
||||
<script type="text/javascript" src="js/toastr.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -297,5 +299,19 @@ echo(' Copyright © 2006-2012 by Adam Armstrong.');
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<?php
|
||||
|
||||
if(is_array($msg_box)) {
|
||||
echo("<script>
|
||||
toastr.options.timeout = 10;
|
||||
toastr.options.extendedTimeOut = 20;
|
||||
");
|
||||
foreach ($msg_box as $message) {
|
||||
echo "toastr.".$message['type']."('".$message['message']."','".$message['title']."');\n";
|
||||
}
|
||||
echo("</script>");
|
||||
}
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
1
html/js/toastr.min.js
vendored
Normal file
1
html/js/toastr.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(a){a(["jquery"],function(a){return function(){function b(a,b,c){return o({type:u.error,iconClass:p().iconClasses.error,message:a,optionsOverride:c,title:b})}function c(b,c){return b||(b=p()),r=a("#"+b.containerId),r.length?r:(c&&(r=l(b)),r)}function d(a,b,c){return o({type:u.info,iconClass:p().iconClasses.info,message:a,optionsOverride:c,title:b})}function e(a){s=a}function f(a,b,c){return o({type:u.success,iconClass:p().iconClasses.success,message:a,optionsOverride:c,title:b})}function g(a,b,c){return o({type:u.warning,iconClass:p().iconClasses.warning,message:a,optionsOverride:c,title:b})}function h(a){var b=p();r||c(b),k(a,b)||j(b)}function i(b){var d=p();return r||c(d),b&&0===a(":focus",b).length?void q(b):void(r.children().length&&r.remove())}function j(b){for(var c=r.children(),d=c.length-1;d>=0;d--)k(a(c[d]),b)}function k(b,c){return b&&0===a(":focus",b).length?(b[c.hideMethod]({duration:c.hideDuration,easing:c.hideEasing,complete:function(){q(b)}}),!0):!1}function l(b){return r=a("<div/>").attr("id",b.containerId).addClass(b.positionClass).attr("aria-live","polite").attr("role","alert"),r.appendTo(a(b.target)),r}function m(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",target:"body",closeHtml:"<button>×</button>",newestOnTop:!0}}function n(a){s&&s(a)}function o(b){function d(b){return!a(":focus",j).length||b?j[g.hideMethod]({duration:g.hideDuration,easing:g.hideEasing,complete:function(){q(j),g.onHidden&&"hidden"!==o.state&&g.onHidden(),o.state="hidden",o.endTime=new Date,n(o)}}):void 0}function e(){(g.timeOut>0||g.extendedTimeOut>0)&&(i=setTimeout(d,g.extendedTimeOut))}function f(){clearTimeout(i),j.stop(!0,!0)[g.showMethod]({duration:g.showDuration,easing:g.showEasing})}var g=p(),h=b.iconClass||g.iconClass;"undefined"!=typeof b.optionsOverride&&(g=a.extend(g,b.optionsOverride),h=b.optionsOverride.iconClass||h),t++,r=c(g,!0);var i=null,j=a("<div/>"),k=a("<div/>"),l=a("<div/>"),m=a(g.closeHtml),o={toastId:t,state:"visible",startTime:new Date,options:g,map:b};return b.iconClass&&j.addClass(g.toastClass).addClass(h),b.title&&(k.append(b.title).addClass(g.titleClass),j.append(k)),b.message&&(l.append(b.message).addClass(g.messageClass),j.append(l)),g.closeButton&&(m.addClass("toast-close-button").attr("role","button"),j.prepend(m)),j.hide(),g.newestOnTop?r.prepend(j):r.append(j),j[g.showMethod]({duration:g.showDuration,easing:g.showEasing,complete:g.onShown}),g.timeOut>0&&(i=setTimeout(d,g.timeOut)),j.hover(f,e),!g.onclick&&g.tapToDismiss&&j.click(d),g.closeButton&&m&&m.click(function(a){a.stopPropagation?a.stopPropagation():void 0!==a.cancelBubble&&a.cancelBubble!==!0&&(a.cancelBubble=!0),d(!0)}),g.onclick&&j.click(function(){g.onclick(),d()}),n(o),g.debug&&console&&console.log(o),j}function p(){return a.extend({},m(),v.options)}function q(a){r||(r=c()),a.is(":visible")||(a.remove(),a=null,0===r.children().length&&r.remove())}var r,s,t=0,u={error:"error",info:"info",success:"success",warning:"warning"},v={clear:h,remove:i,error:b,getContainer:c,info:d,options:{},subscribe:e,success:f,version:"2.0.3",warning:g};return v}()})}("function"==typeof define&&define.amd?define:function(a,b){"undefined"!=typeof module&&module.exports?module.exports=b(require("jquery")):window.toastr=b(window.jQuery)});
|
||||
Reference in New Issue
Block a user