mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-06-14 20:16:05 +00:00
Initial commit
This commit is contained in:
21
app/static/global/plugins/bootstrap-growl/LICENSE.md
Normal file
21
app/static/global/plugins/bootstrap-growl/LICENSE.md
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) Nick Larson, http://github.com/ifightcrime
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
51
app/static/global/plugins/bootstrap-growl/README.md
Normal file
51
app/static/global/plugins/bootstrap-growl/README.md
Normal file
@ -0,0 +1,51 @@
|
||||
#bootstrap-growl
|
||||
|
||||
Pretty simple jQuery plugin that turns standard Bootstrap alerts into hovering "Growl-like" notifications.
|
||||
|
||||
##Demo
|
||||
|
||||
I have a basic demo set up at jsfiddle for the time being which you can view here: http://jsfiddle.net/ifightcrime/Us6WX/1008/
|
||||
|
||||
##Features
|
||||
|
||||
* Uses standard [Twitter Bootstrap alerts](http://twitter.github.com/bootstrap/components.html#alerts) which provides 'info', 'danger', and 'success' styles.
|
||||
* Multiple growls called consecutively are stacked up one after another in a list.
|
||||
* Automatically fades growls away after a default of 4 seconds.
|
||||
|
||||
##Dependencies
|
||||
|
||||
1. Latest version of jQuery. (tested on 1.11.0)
|
||||
2. [Twitter Bootstrap](http://twitter.github.com/bootstrap/index.html). (current rev tested with 3.3.1)
|
||||
|
||||
##Usage
|
||||
|
||||
Include the dependencies and `jquery.bootstrap-growl.min.js` into your page and call the following:
|
||||
|
||||
```javascript
|
||||
$.bootstrapGrowl("My message");
|
||||
```
|
||||
|
||||
##Available Options
|
||||
|
||||
By default, growls use the standard 'alert' Bootstrap style, are 250px wide, right aligned, and are positioned 20px from the top right of the page.
|
||||
|
||||
```javascript
|
||||
$.bootstrapGrowl("another message, yay!", {
|
||||
ele: 'body', // which element to append to
|
||||
type: 'info', // (null, 'info', 'danger', 'success')
|
||||
offset: {from: 'top', amount: 20}, // 'top', or 'bottom'
|
||||
align: 'right', // ('left', 'right', or 'center')
|
||||
width: 250, // (integer, or 'auto')
|
||||
delay: 4000, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
|
||||
allow_dismiss: true, // If true then will display a cross to close the popup.
|
||||
stackup_spacing: 10 // spacing between consecutively stacked growls.
|
||||
});
|
||||
```
|
||||
|
||||
Note: Previous ```top_offset``` is not broken by this latest change.
|
||||
|
||||
##Additional Contributors
|
||||
|
||||
* Jose Martinez https://github.com/callado4
|
||||
* Lloyd Watkin https://github.com/lloydwatkin
|
||||
* TruongSinh Tran-Nguyen https://github.com/tran-nguyen
|
43
app/static/global/plugins/bootstrap-growl/demo.html
Normal file
43
app/static/global/plugins/bootstrap-growl/demo.html
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>jquery.bootstrap-growl Demo</title>
|
||||
<link rel="stylesheet" type="text/css" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
|
||||
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
|
||||
<script src="jquery.bootstrap-growl.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
$.bootstrapGrowl("This is a test.");
|
||||
|
||||
setTimeout(function() {
|
||||
$.bootstrapGrowl("This is another test.", { type: 'success' });
|
||||
}, 1000);
|
||||
|
||||
setTimeout(function() {
|
||||
$.bootstrapGrowl("Danger, Danger!", {
|
||||
type: 'danger',
|
||||
align: 'center',
|
||||
width: 'auto',
|
||||
allow_dismiss: false
|
||||
});
|
||||
}, 2000);
|
||||
|
||||
setTimeout(function() {
|
||||
$.bootstrapGrowl("Danger, Danger!", {
|
||||
type: 'info',
|
||||
align: 'left',
|
||||
stackup_spacing: 30
|
||||
});
|
||||
}, 3000);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,77 @@
|
||||
(function() {
|
||||
var $;
|
||||
|
||||
$ = jQuery;
|
||||
|
||||
$.bootstrapGrowl = function(message, options) {
|
||||
var $alert, css, offsetAmount;
|
||||
options = $.extend({}, $.bootstrapGrowl.default_options, options);
|
||||
$alert = $("<div>");
|
||||
$alert.attr("class", "bootstrap-growl alert");
|
||||
if (options.type) {
|
||||
$alert.addClass("alert-" + options.type);
|
||||
}
|
||||
if (options.allow_dismiss) {
|
||||
$alert.addClass("alert-dismissible");
|
||||
$alert.append("<button class=\"close\" data-dismiss=\"alert\" type=\"button\"><span aria-hidden=\"true\">×</span><span class=\"sr-only\">Close</span></button>");
|
||||
}
|
||||
$alert.append(message);
|
||||
if (options.top_offset) {
|
||||
options.offset = {
|
||||
from: "top",
|
||||
amount: options.top_offset
|
||||
};
|
||||
}
|
||||
offsetAmount = options.offset.amount;
|
||||
$(".bootstrap-growl").each(function() {
|
||||
return offsetAmount = Math.max(offsetAmount, parseInt($(this).css(options.offset.from)) + $(this).outerHeight() + options.stackup_spacing);
|
||||
});
|
||||
css = {
|
||||
"position": (options.ele === "body" ? "fixed" : "absolute"),
|
||||
"margin": 0,
|
||||
"z-index": "9999",
|
||||
"display": "none"
|
||||
};
|
||||
css[options.offset.from] = offsetAmount + "px";
|
||||
$alert.css(css);
|
||||
if (options.width !== "auto") {
|
||||
$alert.css("width", options.width + "px");
|
||||
}
|
||||
$(options.ele).append($alert);
|
||||
switch (options.align) {
|
||||
case "center":
|
||||
$alert.css({
|
||||
"left": "50%",
|
||||
"margin-left": "-" + ($alert.outerWidth() / 2) + "px"
|
||||
});
|
||||
break;
|
||||
case "left":
|
||||
$alert.css("left", "20px");
|
||||
break;
|
||||
default:
|
||||
$alert.css("right", "20px");
|
||||
}
|
||||
$alert.fadeIn();
|
||||
if (options.delay > 0) {
|
||||
$alert.delay(options.delay).fadeOut(function() {
|
||||
return $(this).alert("close");
|
||||
});
|
||||
}
|
||||
return $alert;
|
||||
};
|
||||
|
||||
$.bootstrapGrowl.default_options = {
|
||||
ele: "body",
|
||||
type: "info",
|
||||
offset: {
|
||||
from: "top",
|
||||
amount: 20
|
||||
},
|
||||
align: "right",
|
||||
width: 250,
|
||||
delay: 4000,
|
||||
allow_dismiss: true,
|
||||
stackup_spacing: 10
|
||||
};
|
||||
|
||||
}).call(this);
|
1
app/static/global/plugins/bootstrap-growl/jquery.bootstrap-growl.min.js
vendored
Normal file
1
app/static/global/plugins/bootstrap-growl/jquery.bootstrap-growl.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(function(){var c;c=jQuery;c.bootstrapGrowl=function(f,a){var b,e,d;a=c.extend({},c.bootstrapGrowl.default_options,a);b=c("<div>");b.attr("class","bootstrap-growl alert");a.type&&b.addClass("alert-"+a.type);a.allow_dismiss&&(b.addClass("alert-dismissible"),b.append('<button class="close" data-dismiss="alert" type="button"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>'));b.append(f);a.top_offset&&(a.offset={from:"top",amount:a.top_offset});d=a.offset.amount;c(".bootstrap-growl").each(function(){return d= Math.max(d,parseInt(c(this).css(a.offset.from))+c(this).outerHeight()+a.stackup_spacing)});e={position:"body"===a.ele?"fixed":"absolute",margin:0,"z-index":"9999",display:"none"};e[a.offset.from]=d+"px";b.css(e);"auto"!==a.width&&b.css("width",a.width+"px");c(a.ele).append(b);switch(a.align){case "center":b.css({left:"50%","margin-left":"-"+b.outerWidth()/2+"px"});break;case "left":b.css("left","20px");break;default:b.css("right","20px")}b.fadeIn();0<a.delay&&b.delay(a.delay).fadeOut(function(){return c(this).alert("close")}); return b};c.bootstrapGrowl.default_options={ele:"body",type:"info",offset:{from:"top",amount:20},align:"right",width:250,delay:4E3,allow_dismiss:!0,stackup_spacing:10}}).call(this);
|
Reference in New Issue
Block a user