put js libs
This commit is contained in:
parent
6e64a1c144
commit
b5827c070e
365
pypowerdns/static/css/formalize.css
Normal file
365
pypowerdns/static/css/formalize.css
Normal file
@ -0,0 +1,365 @@
|
||||
.input_tiny {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.input_small {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.input_medium {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.input_large {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.input_xlarge {
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
.input_xxlarge {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.input_full {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.input_full_wrap {
|
||||
display: block;
|
||||
padding-right: 8px;
|
||||
}
|
||||
|
||||
input[type="search"]::-webkit-search-decoration {
|
||||
display: none;
|
||||
}
|
||||
|
||||
input:invalid,
|
||||
button:invalid,
|
||||
a.button:invalid,
|
||||
select:invalid,
|
||||
textarea:invalid {
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
input:focus,
|
||||
button:focus,
|
||||
a.button:focus,
|
||||
select:focus,
|
||||
textarea:focus {
|
||||
-webkit-box-shadow: #0066ff 0 0 5px 0;
|
||||
-moz-box-shadow: #0066ff 0 0 5px 0;
|
||||
box-shadow: #0066ff 0 0 5px 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
input[type="file"]:focus, input[type="file"]:active,
|
||||
input[type="radio"]:focus,
|
||||
input[type="radio"]:active,
|
||||
input[type="checkbox"]:focus,
|
||||
input[type="checkbox"]:active {
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
button,
|
||||
a.button,
|
||||
input[type="reset"],
|
||||
input[type="submit"],
|
||||
input[type="button"] {
|
||||
-webkit-appearance: none;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
-ms-border-radius: 4px;
|
||||
-o-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-webkit-background-clip: padding;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
background: #dddddd url('../images/button.png?1298351022') repeat-x;
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #dddddd));
|
||||
background-image: -webkit-linear-gradient(#ffffff, #dddddd);
|
||||
background-image: -moz-linear-gradient(#ffffff, #dddddd);
|
||||
background-image: -o-linear-gradient(#ffffff, #dddddd);
|
||||
background-image: linear-gradient(#ffffff, #dddddd);
|
||||
border: 1px solid;
|
||||
border-color: #dddddd #bbbbbb #999999;
|
||||
cursor: pointer;
|
||||
color: #333333;
|
||||
display: inline-block;
|
||||
font: bold 12px/1.3 "Helvetica Neue", Arial, "Liberation Sans", FreeSans, sans-serif;
|
||||
outline: 0;
|
||||
overflow: visible;
|
||||
margin: 0;
|
||||
padding: 3px 10px;
|
||||
text-shadow: white 0 1px 1px;
|
||||
text-decoration: none;
|
||||
vertical-align: top;
|
||||
width: auto;
|
||||
*padding-top: 2px;
|
||||
*padding-bottom: 0;
|
||||
}
|
||||
button:hover,
|
||||
a.button:hover,
|
||||
input[type="reset"]:hover,
|
||||
input[type="submit"]:hover,
|
||||
input[type="button"]:hover {
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(1px, #eeeeee), color-stop(100%, #cccccc));
|
||||
background-image: -webkit-linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
|
||||
background-image: -moz-linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
|
||||
background-image: -o-linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
|
||||
background-image: linear-gradient(#ffffff, #eeeeee 1px, #cccccc);
|
||||
text-decoration: none;
|
||||
}
|
||||
button:active,
|
||||
a.button:active,
|
||||
input[type="reset"]:active,
|
||||
input[type="submit"]:active,
|
||||
input[type="button"]:active {
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #dddddd), color-stop(100%, #eeeeee));
|
||||
background-image: -webkit-linear-gradient(#dddddd, #eeeeee);
|
||||
background-image: -moz-linear-gradient(#dddddd, #eeeeee);
|
||||
background-image: -o-linear-gradient(#dddddd, #eeeeee);
|
||||
background-image: linear-gradient(#dddddd, #eeeeee);
|
||||
-webkit-box-shadow: inset rgba(0, 0, 0, 0.25) 0 1px 2px 0;
|
||||
-moz-box-shadow: inset rgba(0, 0, 0, 0.25) 0 1px 2px 0;
|
||||
box-shadow: inset rgba(0, 0, 0, 0.25) 0 1px 2px 0;
|
||||
border-color: #999999 #bbbbbb #dddddd;
|
||||
}
|
||||
button::-moz-focus-inner,
|
||||
a.button::-moz-focus-inner,
|
||||
input[type="reset"]::-moz-focus-inner,
|
||||
input[type="submit"]::-moz-focus-inner,
|
||||
input[type="button"]::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
a.button {
|
||||
*padding-bottom: 3px;
|
||||
}
|
||||
|
||||
button {
|
||||
*padding-top: 1px;
|
||||
*padding-bottom: 1px;
|
||||
}
|
||||
|
||||
textarea,
|
||||
select,
|
||||
input[type="date"],
|
||||
input[type="datetime"],
|
||||
input[type="datetime-local"],
|
||||
input[type="email"],
|
||||
input[type="month"],
|
||||
input[type="number"],
|
||||
input[type="password"],
|
||||
input[type="search"],
|
||||
input[type="tel"],
|
||||
input[type="text"],
|
||||
input[type="time"],
|
||||
input[type="url"],
|
||||
input[type="week"] {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
-webkit-background-clip: padding;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
-webkit-border-radius: 0;
|
||||
-moz-border-radius: 0;
|
||||
-ms-border-radius: 0;
|
||||
-o-border-radius: 0;
|
||||
border-radius: 0;
|
||||
-webkit-appearance: none;
|
||||
background-color: white;
|
||||
border: 1px solid;
|
||||
border-color: #848484 #c1c1c1 #e1e1e1;
|
||||
color: black;
|
||||
outline: 0;
|
||||
margin: 0;
|
||||
padding: 2px 3px;
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
font-family: Arial, "Liberation Sans", FreeSans, sans-serif;
|
||||
height: 1.8em;
|
||||
vertical-align: top;
|
||||
*padding-top: 2px;
|
||||
*padding-bottom: 1px;
|
||||
*height: auto;
|
||||
}
|
||||
textarea[disabled],
|
||||
select[disabled],
|
||||
input[type="date"][disabled],
|
||||
input[type="datetime"][disabled],
|
||||
input[type="datetime-local"][disabled],
|
||||
input[type="email"][disabled],
|
||||
input[type="month"][disabled],
|
||||
input[type="number"][disabled],
|
||||
input[type="password"][disabled],
|
||||
input[type="search"][disabled],
|
||||
input[type="tel"][disabled],
|
||||
input[type="text"][disabled],
|
||||
input[type="time"][disabled],
|
||||
input[type="url"][disabled],
|
||||
input[type="week"][disabled] {
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
|
||||
button[disabled],
|
||||
input[disabled],
|
||||
select[disabled],
|
||||
select[disabled] option,
|
||||
select[disabled] optgroup,
|
||||
textarea[disabled],
|
||||
a.button_disabled {
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
-moz-user-select: -moz-none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
user-select: none;
|
||||
color: #888888;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
input::-webkit-input-placeholder,
|
||||
textarea::-webkit-input-placeholder {
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
input:-moz-placeholder,
|
||||
textarea:-moz-placeholder {
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
input.placeholder_text,
|
||||
textarea.placeholder_text {
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
textarea,
|
||||
select[size],
|
||||
select[multiple] {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
select[size="0"],
|
||||
select[size="1"] {
|
||||
height: 1.8em;
|
||||
*height: auto;
|
||||
}
|
||||
|
||||
@media (-webkit-min-device-pixel-ratio: 0) {
|
||||
select[size],
|
||||
select[multiple],
|
||||
select[multiple][size] {
|
||||
background-image: none;
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
select,
|
||||
select[size="0"],
|
||||
select[size="1"] {
|
||||
background-image: url(data:image/png;base64,R0lGODlhDQAEAIAAAAAAAP8A/yH5BAEHAAEALAAAAAANAAQAAAILhA+hG5jMDpxvhgIAOw==);
|
||||
background-repeat: no-repeat;
|
||||
background-position: right center;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
::-webkit-validation-bubble-message {
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #666666), color-stop(1, black));
|
||||
border: 0;
|
||||
color: white;
|
||||
font: 13px/17px "Lucida Grande", Arial, "Liberation Sans", FreeSans, sans-serif;
|
||||
overflow: hidden;
|
||||
padding: 15px 15px 17px;
|
||||
text-shadow: black 0 0 1px;
|
||||
min-height: 16px;
|
||||
}
|
||||
|
||||
::-webkit-validation-bubble-arrow,
|
||||
::-webkit-validation-bubble-top-outer-arrow,
|
||||
::-webkit-validation-bubble-top-inner-arrow {
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
background: #666666;
|
||||
border-color: #666666;
|
||||
}
|
||||
}
|
||||
textarea {
|
||||
min-height: 40px;
|
||||
overflow: auto;
|
||||
resize: vertical;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
optgroup {
|
||||
color: black;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
font-family: Arial, "Liberation Sans", FreeSans, sans-serif;
|
||||
}
|
||||
optgroup::-moz-focus-inner {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ie6_button,
|
||||
* html button,
|
||||
* html a.button {
|
||||
background: #dddddd url('../images/button.png?1298351022') repeat-x;
|
||||
border: 1px solid;
|
||||
border-color: #dddddd #bbbbbb #999999;
|
||||
cursor: pointer;
|
||||
color: #333333;
|
||||
font: bold 12px/1.2 Arial, sans-serif;
|
||||
padding: 2px 10px 0px;
|
||||
text-decoration: none;
|
||||
overflow: visible;
|
||||
vertical-align: top;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
* html a.button {
|
||||
position: relative;
|
||||
top: 3px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
* html button {
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
|
||||
.ie6_input,
|
||||
* html textarea,
|
||||
* html select {
|
||||
background: white;
|
||||
border: 1px solid;
|
||||
border-color: #848484 #c1c1c1 #e1e1e1;
|
||||
color: black;
|
||||
padding: 2px 3px 1px;
|
||||
font-size: 13px;
|
||||
font-family: Arial, sans-serif;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
* html select {
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
.placeholder_text,
|
||||
.ie6_input_disabled,
|
||||
.ie6_button_disabled {
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
.ie6_input_disabled {
|
||||
background: #eeeeee;
|
||||
}
|
BIN
pypowerdns/static/img/dialog-error.png
Executable file
BIN
pypowerdns/static/img/dialog-error.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
2
pypowerdns/static/js/jquery-1.8.3.min.js
vendored
Normal file
2
pypowerdns/static/js/jquery-1.8.3.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
pypowerdns/static/js/jquery.formalize.min.js
vendored
Normal file
1
pypowerdns/static/js/jquery.formalize.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
var FORMALIZE=function(e,t,n,r){function i(e){var t=n.createElement("b");return t.innerHTML="<!--[if IE "+e+"]><br><![endif]-->",!!t.getElementsByTagName("br").length}var s="placeholder"in n.createElement("input"),o="autofocus"in n.createElement("input"),u=i(6),a=i(7);return{go:function(){var e,t=this.init;for(e in t)t.hasOwnProperty(e)&&t[e]()},init:{disable_link_button:function(){e(n.documentElement).on("click","a.button_disabled",function(){return!1})},full_input_size:function(){if(!a||!e("textarea, input.input_full").length)return;e("textarea, input.input_full").wrap('<span class="input_full_wrap"></span>')},ie6_skin_inputs:function(){if(!u||!e("input, select, textarea").length)return;var t=/button|submit|reset/,n=/date|datetime|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/;e("input").each(function(){var r=e(this);this.getAttribute("type").match(t)?(r.addClass("ie6_button"),this.disabled&&r.addClass("ie6_button_disabled")):this.getAttribute("type").match(n)&&(r.addClass("ie6_input"),this.disabled&&r.addClass("ie6_input_disabled"))}),e("textarea, select").each(function(){this.disabled&&e(this).addClass("ie6_input_disabled")})},autofocus:function(){if(o||!e(":input[autofocus]").length)return;var t=e("[autofocus]")[0];t.disabled||t.focus()},placeholder:function(){if(s||!e(":input[placeholder]").length)return;FORMALIZE.misc.add_placeholder(),e(":input[placeholder]").each(function(){if(this.type==="password")return;var t=e(this),n=t.attr("placeholder");t.focus(function(){t.val()===n&&t.val("").removeClass("placeholder_text")}).blur(function(){FORMALIZE.misc.add_placeholder()}),t.closest("form").submit(function(){t.val()===n&&t.val("").removeClass("placeholder_text")}).on("reset",function(){setTimeout(FORMALIZE.misc.add_placeholder,50)})})}},misc:{add_placeholder:function(){if(s||!e(":input[placeholder]").length)return;e(":input[placeholder]").each(function(){if(this.type==="password")return;var t=e(this),n=t.attr("placeholder");(!t.val()||t.val()===n)&&t.val(n).addClass("placeholder_text")})}}}}(jQuery,this,this.document);jQuery(document).ready(function(){FORMALIZE.go()})
|
520
pypowerdns/static/js/noty/jquery.noty.js
Normal file
520
pypowerdns/static/js/noty/jquery.noty.js
Normal file
@ -0,0 +1,520 @@
|
||||
/**
|
||||
* noty - jQuery Notification Plugin v2.0.3
|
||||
* Contributors: https://github.com/needim/noty/graphs/contributors
|
||||
*
|
||||
* Examples and Documentation - http://needim.github.com/noty/
|
||||
*
|
||||
* Licensed under the MIT licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
**/
|
||||
|
||||
if (typeof Object.create !== 'function') {
|
||||
Object.create = function (o) {
|
||||
function F() {
|
||||
}
|
||||
|
||||
F.prototype = o;
|
||||
return new F();
|
||||
};
|
||||
}
|
||||
|
||||
(function ($) {
|
||||
|
||||
var NotyObject = {
|
||||
|
||||
init:function (options) {
|
||||
|
||||
// Mix in the passed in options with the default options
|
||||
this.options = $.extend({}, $.noty.defaults, options);
|
||||
|
||||
this.options.layout = (this.options.custom) ? $.noty.layouts['inline'] : $.noty.layouts[this.options.layout];
|
||||
this.options.theme = $.noty.themes[this.options.theme];
|
||||
|
||||
delete options.layout;
|
||||
delete options.theme;
|
||||
|
||||
this.options = $.extend({}, this.options, this.options.layout.options);
|
||||
this.options.id = 'noty_' + (new Date().getTime() * Math.floor(Math.random() * 1000000));
|
||||
|
||||
this.options = $.extend({}, this.options, options);
|
||||
|
||||
// Build the noty dom initial structure
|
||||
this._build();
|
||||
|
||||
// return this so we can chain/use the bridge with less code.
|
||||
return this;
|
||||
}, // end init
|
||||
|
||||
_build:function () {
|
||||
|
||||
// Generating noty bar
|
||||
var $bar = $('<div class="noty_bar"></div>').attr('id', this.options.id);
|
||||
$bar.append(this.options.template).find('.noty_text').html(this.options.text);
|
||||
|
||||
this.$bar = (this.options.layout.parent.object !== null) ? $(this.options.layout.parent.object).css(this.options.layout.parent.css).append($bar) : $bar;
|
||||
|
||||
// Set buttons if available
|
||||
if (this.options.buttons) {
|
||||
|
||||
// If we have button disable closeWith & timeout options
|
||||
this.options.closeWith = [];
|
||||
this.options.timeout = false;
|
||||
|
||||
var $buttons = $('<div/>').addClass('noty_buttons');
|
||||
|
||||
(this.options.layout.parent.object !== null) ? this.$bar.find('.noty_bar').append($buttons) : this.$bar.append($buttons);
|
||||
|
||||
var self = this;
|
||||
|
||||
$.each(this.options.buttons, function (i, button) {
|
||||
var $button = $('<button/>').addClass((button.addClass) ? button.addClass : 'gray').html(button.text)
|
||||
.appendTo(self.$bar.find('.noty_buttons'))
|
||||
.bind('click', function () {
|
||||
if ($.isFunction(button.onClick)) {
|
||||
button.onClick.call($button, self);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// For easy access
|
||||
this.$message = this.$bar.find('.noty_message');
|
||||
this.$closeButton = this.$bar.find('.noty_close');
|
||||
this.$buttons = this.$bar.find('.noty_buttons');
|
||||
|
||||
$.noty.store[this.options.id] = this; // store noty for api
|
||||
|
||||
}, // end _build
|
||||
|
||||
show:function () {
|
||||
|
||||
var self = this;
|
||||
|
||||
$(self.options.layout.container.selector).append(self.$bar);
|
||||
|
||||
self.options.theme.style.apply(self);
|
||||
|
||||
($.type(self.options.layout.css) === 'function') ? this.options.layout.css.apply(self.$bar) : self.$bar.css(this.options.layout.css || {});
|
||||
|
||||
self.$bar.addClass(self.options.layout.addClass);
|
||||
|
||||
self.options.layout.container.style.apply($(self.options.layout.container.selector));
|
||||
|
||||
self.options.theme.callback.onShow.apply(this);
|
||||
|
||||
if ($.inArray('click', self.options.closeWith) > -1)
|
||||
self.$bar.css('cursor', 'pointer').one('click', function () {
|
||||
self.close();
|
||||
});
|
||||
|
||||
if ($.inArray('hover', self.options.closeWith) > -1)
|
||||
self.$bar.one('mouseenter', function () {
|
||||
self.close();
|
||||
});
|
||||
|
||||
if ($.inArray('button', self.options.closeWith) > -1)
|
||||
self.$closeButton.one('click', function () {
|
||||
self.close();
|
||||
});
|
||||
|
||||
if ($.inArray('button', self.options.closeWith) == -1)
|
||||
self.$closeButton.remove();
|
||||
|
||||
if (self.options.callback.onShow)
|
||||
self.options.callback.onShow.apply(self);
|
||||
|
||||
self.$bar.animate(
|
||||
self.options.animation.open,
|
||||
self.options.animation.speed,
|
||||
self.options.animation.easing,
|
||||
function () {
|
||||
if (self.options.callback.afterShow) self.options.callback.afterShow.apply(self);
|
||||
self.shown = true;
|
||||
});
|
||||
|
||||
// If noty is have a timeout option
|
||||
if (self.options.timeout)
|
||||
self.$bar.delay(self.options.timeout).promise().done(function () {
|
||||
self.close();
|
||||
});
|
||||
|
||||
return this;
|
||||
|
||||
}, // end show
|
||||
|
||||
close:function () {
|
||||
|
||||
if (this.closed) return;
|
||||
|
||||
var self = this;
|
||||
|
||||
if (!this.shown) { // If we are still waiting in the queue just delete from queue
|
||||
var queue = [];
|
||||
$.each($.noty.queue, function (i, n) {
|
||||
if (n.options.id != self.options.id) {
|
||||
queue.push(n);
|
||||
}
|
||||
});
|
||||
$.noty.queue = queue;
|
||||
return;
|
||||
}
|
||||
|
||||
self.$bar.addClass('i-am-closing-now');
|
||||
|
||||
if (self.options.callback.onClose) {
|
||||
self.options.callback.onClose.apply(self);
|
||||
}
|
||||
|
||||
self.$bar.clearQueue().stop().animate(
|
||||
self.options.animation.close,
|
||||
self.options.animation.speed,
|
||||
self.options.animation.easing,
|
||||
function () {
|
||||
if (self.options.callback.afterClose) self.options.callback.afterClose.apply(self);
|
||||
})
|
||||
.promise().done(function () {
|
||||
|
||||
// Modal Cleaning
|
||||
if (self.options.modal) {
|
||||
$.notyRenderer.setModalCount(-1);
|
||||
if ($.notyRenderer.getModalCount() == 0) $('.noty_modal').fadeOut('fast', function () {
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
|
||||
// Layout Cleaning
|
||||
$.notyRenderer.setLayoutCountFor(self, -1);
|
||||
if ($.notyRenderer.getLayoutCountFor(self) == 0) $(self.options.layout.container.selector).remove();
|
||||
|
||||
// Make sure self.$bar has not been removed before attempting to remove it
|
||||
if (typeof self.$bar !== 'undefined' && self.$bar !== null ) {
|
||||
self.$bar.remove();
|
||||
self.$bar = null;
|
||||
self.closed = true;
|
||||
}
|
||||
|
||||
delete $.noty.store[self.options.id]; // deleting noty from store
|
||||
|
||||
self.options.theme.callback.onClose.apply(self);
|
||||
|
||||
if (!self.options.dismissQueue) {
|
||||
// Queue render
|
||||
$.noty.ontap = true;
|
||||
|
||||
$.notyRenderer.render();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}, // end close
|
||||
|
||||
setText:function (text) {
|
||||
if (!this.closed) {
|
||||
this.options.text = text;
|
||||
this.$bar.find('.noty_text').html(text);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
setType:function (type) {
|
||||
if (!this.closed) {
|
||||
this.options.type = type;
|
||||
this.options.theme.style.apply(this);
|
||||
this.options.theme.callback.onShow.apply(this);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
setTimeout:function (time) {
|
||||
if (!this.closed) {
|
||||
var self = this;
|
||||
this.options.timeout = time;
|
||||
self.$bar.delay(self.options.timeout).promise().done(function () {
|
||||
self.close();
|
||||
});
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
closed:false,
|
||||
shown:false
|
||||
|
||||
}; // end NotyObject
|
||||
|
||||
$.notyRenderer = {};
|
||||
|
||||
$.notyRenderer.init = function (options) {
|
||||
|
||||
// Renderer creates a new noty
|
||||
var notification = Object.create(NotyObject).init(options);
|
||||
|
||||
(notification.options.force) ? $.noty.queue.unshift(notification) : $.noty.queue.push(notification);
|
||||
|
||||
$.notyRenderer.render();
|
||||
|
||||
return ($.noty.returns == 'object') ? notification : notification.options.id;
|
||||
};
|
||||
|
||||
$.notyRenderer.render = function () {
|
||||
|
||||
var instance = $.noty.queue[0];
|
||||
|
||||
if ($.type(instance) === 'object') {
|
||||
if (instance.options.dismissQueue) {
|
||||
$.notyRenderer.show($.noty.queue.shift());
|
||||
} else {
|
||||
if ($.noty.ontap) {
|
||||
$.notyRenderer.show($.noty.queue.shift());
|
||||
$.noty.ontap = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$.noty.ontap = true; // Queue is over
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.notyRenderer.show = function (notification) {
|
||||
|
||||
if (notification.options.modal) {
|
||||
$.notyRenderer.createModalFor(notification);
|
||||
$.notyRenderer.setModalCount(+1);
|
||||
}
|
||||
|
||||
// Where is the container?
|
||||
if ($(notification.options.layout.container.selector).length == 0) {
|
||||
if (notification.options.custom) {
|
||||
notification.options.custom.append($(notification.options.layout.container.object).addClass('i-am-new'));
|
||||
} else {
|
||||
$('body').append($(notification.options.layout.container.object).addClass('i-am-new'));
|
||||
}
|
||||
} else {
|
||||
$(notification.options.layout.container.selector).removeClass('i-am-new');
|
||||
}
|
||||
|
||||
$.notyRenderer.setLayoutCountFor(notification, +1);
|
||||
|
||||
notification.show();
|
||||
};
|
||||
|
||||
$.notyRenderer.createModalFor = function (notification) {
|
||||
if ($('.noty_modal').length == 0)
|
||||
$('<div/>').addClass('noty_modal').data('noty_modal_count', 0).css(notification.options.theme.modal.css).prependTo($('body')).fadeIn('fast');
|
||||
};
|
||||
|
||||
$.notyRenderer.getLayoutCountFor = function (notification) {
|
||||
return $(notification.options.layout.container.selector).data('noty_layout_count') || 0;
|
||||
};
|
||||
|
||||
$.notyRenderer.setLayoutCountFor = function (notification, arg) {
|
||||
return $(notification.options.layout.container.selector).data('noty_layout_count', $.notyRenderer.getLayoutCountFor(notification) + arg);
|
||||
};
|
||||
|
||||
$.notyRenderer.getModalCount = function () {
|
||||
return $('.noty_modal').data('noty_modal_count') || 0;
|
||||
};
|
||||
|
||||
$.notyRenderer.setModalCount = function (arg) {
|
||||
return $('.noty_modal').data('noty_modal_count', $.notyRenderer.getModalCount() + arg);
|
||||
};
|
||||
|
||||
// This is for custom container
|
||||
$.fn.noty = function (options) {
|
||||
options.custom = $(this);
|
||||
return $.notyRenderer.init(options);
|
||||
};
|
||||
|
||||
$.noty = {};
|
||||
$.noty.queue = [];
|
||||
$.noty.ontap = true;
|
||||
$.noty.layouts = {};
|
||||
$.noty.themes = {};
|
||||
$.noty.returns = 'object';
|
||||
$.noty.store = {};
|
||||
|
||||
$.noty.get = function (id) {
|
||||
return $.noty.store.hasOwnProperty(id) ? $.noty.store[id] : false;
|
||||
};
|
||||
|
||||
$.noty.close = function (id) {
|
||||
return $.noty.get(id) ? $.noty.get(id).close() : false;
|
||||
};
|
||||
|
||||
$.noty.setText = function (id, text) {
|
||||
return $.noty.get(id) ? $.noty.get(id).setText(text) : false;
|
||||
};
|
||||
|
||||
$.noty.setType = function (id, type) {
|
||||
return $.noty.get(id) ? $.noty.get(id).setType(type) : false;
|
||||
};
|
||||
|
||||
$.noty.clearQueue = function () {
|
||||
$.noty.queue = [];
|
||||
};
|
||||
|
||||
$.noty.closeAll = function () {
|
||||
$.noty.clearQueue();
|
||||
$.each($.noty.store, function (id, noty) {
|
||||
noty.close();
|
||||
});
|
||||
};
|
||||
|
||||
var windowAlert = window.alert;
|
||||
|
||||
$.noty.consumeAlert = function (options) {
|
||||
window.alert = function (text) {
|
||||
if (options)
|
||||
options.text = text;
|
||||
else
|
||||
options = {text:text};
|
||||
|
||||
$.notyRenderer.init(options);
|
||||
};
|
||||
};
|
||||
|
||||
$.noty.stopConsumeAlert = function () {
|
||||
window.alert = windowAlert;
|
||||
};
|
||||
|
||||
$.noty.defaults = {
|
||||
layout:'top',
|
||||
theme:'defaultTheme',
|
||||
type:'alert',
|
||||
text:'',
|
||||
dismissQueue:true,
|
||||
template:'<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',
|
||||
animation:{
|
||||
open:{height:'toggle'},
|
||||
close:{height:'toggle'},
|
||||
easing:'swing',
|
||||
speed:500
|
||||
},
|
||||
timeout:false,
|
||||
force:false,
|
||||
modal:false,
|
||||
closeWith:['click'],
|
||||
callback:{
|
||||
onShow:function () {
|
||||
},
|
||||
afterShow:function () {
|
||||
},
|
||||
onClose:function () {
|
||||
},
|
||||
afterClose:function () {
|
||||
}
|
||||
},
|
||||
buttons:false
|
||||
};
|
||||
|
||||
$(window).resize(function () {
|
||||
$.each($.noty.layouts, function (index, layout) {
|
||||
layout.container.style.apply($(layout.container.selector));
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
||||
// Helpers
|
||||
function noty(options) {
|
||||
|
||||
// This is for BC - Will be deleted on v2.2.0
|
||||
var using_old = 0
|
||||
, old_to_new = {
|
||||
'animateOpen':'animation.open',
|
||||
'animateClose':'animation.close',
|
||||
'easing':'animation.easing',
|
||||
'speed':'animation.speed',
|
||||
'onShow':'callback.onShow',
|
||||
'onShown':'callback.afterShow',
|
||||
'onClose':'callback.onClose',
|
||||
'onClosed':'callback.afterClose'
|
||||
};
|
||||
|
||||
jQuery.each(options, function (key, value) {
|
||||
if (old_to_new[key]) {
|
||||
using_old++;
|
||||
var _new = old_to_new[key].split('.');
|
||||
|
||||
if (!options[_new[0]]) options[_new[0]] = {};
|
||||
|
||||
options[_new[0]][_new[1]] = (value) ? value : function () {
|
||||
};
|
||||
delete options[key];
|
||||
}
|
||||
});
|
||||
|
||||
if (!options.closeWith) {
|
||||
options.closeWith = jQuery.noty.defaults.closeWith;
|
||||
}
|
||||
|
||||
if (options.hasOwnProperty('closeButton')) {
|
||||
using_old++;
|
||||
if (options.closeButton) options.closeWith.push('button');
|
||||
delete options.closeButton;
|
||||
}
|
||||
|
||||
if (options.hasOwnProperty('closeOnSelfClick')) {
|
||||
using_old++;
|
||||
if (options.closeOnSelfClick) options.closeWith.push('click');
|
||||
delete options.closeOnSelfClick;
|
||||
}
|
||||
|
||||
if (options.hasOwnProperty('closeOnSelfOver')) {
|
||||
using_old++;
|
||||
if (options.closeOnSelfOver) options.closeWith.push('hover');
|
||||
delete options.closeOnSelfOver;
|
||||
}
|
||||
|
||||
if (options.hasOwnProperty('custom')) {
|
||||
using_old++;
|
||||
if (options.custom.container != 'null') options.custom = options.custom.container;
|
||||
}
|
||||
|
||||
if (options.hasOwnProperty('cssPrefix')) {
|
||||
using_old++;
|
||||
delete options.cssPrefix;
|
||||
}
|
||||
|
||||
if (options.theme == 'noty_theme_default') {
|
||||
using_old++;
|
||||
options.theme = 'defaultTheme';
|
||||
}
|
||||
|
||||
if (!options.hasOwnProperty('dismissQueue')) {
|
||||
if (options.layout == 'topLeft'
|
||||
|| options.layout == 'topRight'
|
||||
|| options.layout == 'bottomLeft'
|
||||
|| options.layout == 'bottomRight') {
|
||||
options.dismissQueue = true;
|
||||
} else {
|
||||
options.dismissQueue = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (options.buttons) {
|
||||
jQuery.each(options.buttons, function (i, button) {
|
||||
if (button.click) {
|
||||
using_old++;
|
||||
button.onClick = button.click;
|
||||
delete button.click;
|
||||
}
|
||||
if (button.type) {
|
||||
using_old++;
|
||||
button.addClass = button.type;
|
||||
delete button.type;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (using_old) {
|
||||
if (typeof console !== "undefined" && console.warn) {
|
||||
console.warn('You are using noty v2 with v1.x.x options. @deprecated until v2.2.0 - Please update your options.');
|
||||
}
|
||||
}
|
||||
|
||||
// console.log(options);
|
||||
// End of the BC
|
||||
|
||||
return jQuery.notyRenderer.init(options);
|
||||
}
|
34
pypowerdns/static/js/noty/layouts/bottom.js
Normal file
34
pypowerdns/static/js/noty/layouts/bottom.js
Normal file
@ -0,0 +1,34 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.bottom = {
|
||||
name: 'bottom',
|
||||
options: {},
|
||||
container: {
|
||||
object: '<ul id="noty_bottom_layout_container" />',
|
||||
selector: 'ul#noty_bottom_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
bottom: 0,
|
||||
left: '5%',
|
||||
position: 'fixed',
|
||||
width: '90%',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 9999999
|
||||
});
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
41
pypowerdns/static/js/noty/layouts/bottomCenter.js
Normal file
41
pypowerdns/static/js/noty/layouts/bottomCenter.js
Normal file
@ -0,0 +1,41 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.bottomCenter = {
|
||||
name: 'bottomCenter',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_bottomCenter_layout_container" />',
|
||||
selector: 'ul#noty_bottomCenter_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
bottom: 20,
|
||||
left: 0,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
$(this).css({
|
||||
left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px'
|
||||
});
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
43
pypowerdns/static/js/noty/layouts/bottomLeft.js
Normal file
43
pypowerdns/static/js/noty/layouts/bottomLeft.js
Normal file
@ -0,0 +1,43 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.bottomLeft = {
|
||||
name: 'bottomLeft',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_bottomLeft_layout_container" />',
|
||||
selector: 'ul#noty_bottomLeft_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
bottom: 20,
|
||||
left: 20,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
if (window.innerWidth < 600) {
|
||||
$(this).css({
|
||||
left: 5
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
43
pypowerdns/static/js/noty/layouts/bottomRight.js
Normal file
43
pypowerdns/static/js/noty/layouts/bottomRight.js
Normal file
@ -0,0 +1,43 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.bottomRight = {
|
||||
name: 'bottomRight',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_bottomRight_layout_container" />',
|
||||
selector: 'ul#noty_bottomRight_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
bottom: 20,
|
||||
right: 20,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
if (window.innerWidth < 600) {
|
||||
$(this).css({
|
||||
right: 5
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
56
pypowerdns/static/js/noty/layouts/center.js
Normal file
56
pypowerdns/static/js/noty/layouts/center.js
Normal file
@ -0,0 +1,56 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.center = {
|
||||
name: 'center',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_center_layout_container" />',
|
||||
selector: 'ul#noty_center_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
// getting hidden height
|
||||
var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
|
||||
$("body").append(dupe);
|
||||
dupe.find('.i-am-closing-now').remove();
|
||||
dupe.find('li').css('display', 'block');
|
||||
var actual_height = dupe.height();
|
||||
dupe.remove();
|
||||
|
||||
if ($(this).hasClass('i-am-new')) {
|
||||
$(this).css({
|
||||
left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px',
|
||||
top: ($(window).height() - actual_height) / 2 + 'px'
|
||||
});
|
||||
} else {
|
||||
$(this).animate({
|
||||
left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px',
|
||||
top: ($(window).height() - actual_height) / 2 + 'px'
|
||||
}, 500);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
61
pypowerdns/static/js/noty/layouts/centerLeft.js
Normal file
61
pypowerdns/static/js/noty/layouts/centerLeft.js
Normal file
@ -0,0 +1,61 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.centerLeft = {
|
||||
name: 'centerLeft',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_centerLeft_layout_container" />',
|
||||
selector: 'ul#noty_centerLeft_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
left: 20,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
// getting hidden height
|
||||
var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
|
||||
$("body").append(dupe);
|
||||
dupe.find('.i-am-closing-now').remove();
|
||||
dupe.find('li').css('display', 'block');
|
||||
var actual_height = dupe.height();
|
||||
dupe.remove();
|
||||
|
||||
if ($(this).hasClass('i-am-new')) {
|
||||
$(this).css({
|
||||
top: ($(window).height() - actual_height) / 2 + 'px'
|
||||
});
|
||||
} else {
|
||||
$(this).animate({
|
||||
top: ($(window).height() - actual_height) / 2 + 'px'
|
||||
}, 500);
|
||||
}
|
||||
|
||||
if (window.innerWidth < 600) {
|
||||
$(this).css({
|
||||
left: 5
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
61
pypowerdns/static/js/noty/layouts/centerRight.js
Normal file
61
pypowerdns/static/js/noty/layouts/centerRight.js
Normal file
@ -0,0 +1,61 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.centerRight = {
|
||||
name: 'centerRight',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_centerRight_layout_container" />',
|
||||
selector: 'ul#noty_centerRight_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
right: 20,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
// getting hidden height
|
||||
var dupe = $(this).clone().css({visibility:"hidden", display:"block", position:"absolute", top: 0, left: 0}).attr('id', 'dupe');
|
||||
$("body").append(dupe);
|
||||
dupe.find('.i-am-closing-now').remove();
|
||||
dupe.find('li').css('display', 'block');
|
||||
var actual_height = dupe.height();
|
||||
dupe.remove();
|
||||
|
||||
if ($(this).hasClass('i-am-new')) {
|
||||
$(this).css({
|
||||
top: ($(window).height() - actual_height) / 2 + 'px'
|
||||
});
|
||||
} else {
|
||||
$(this).animate({
|
||||
top: ($(window).height() - actual_height) / 2 + 'px'
|
||||
}, 500);
|
||||
}
|
||||
|
||||
if (window.innerWidth < 600) {
|
||||
$(this).css({
|
||||
right: 5
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
31
pypowerdns/static/js/noty/layouts/inline.js
Normal file
31
pypowerdns/static/js/noty/layouts/inline.js
Normal file
@ -0,0 +1,31 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.inline = {
|
||||
name: 'inline',
|
||||
options: {},
|
||||
container: {
|
||||
object: '<ul id="noty_inline_layout_container" />',
|
||||
selector: 'ul#noty_inline_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
width: '100%',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 9999999
|
||||
});
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
34
pypowerdns/static/js/noty/layouts/top.js
Normal file
34
pypowerdns/static/js/noty/layouts/top.js
Normal file
@ -0,0 +1,34 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.top = {
|
||||
name: 'top',
|
||||
options: {},
|
||||
container: {
|
||||
object: '<ul id="noty_top_layout_container" />',
|
||||
selector: 'ul#noty_top_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
top: 0,
|
||||
left: '5%',
|
||||
position: 'fixed',
|
||||
width: '90%',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 9999999
|
||||
});
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
41
pypowerdns/static/js/noty/layouts/topCenter.js
Normal file
41
pypowerdns/static/js/noty/layouts/topCenter.js
Normal file
@ -0,0 +1,41 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.topCenter = {
|
||||
name: 'topCenter',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_topCenter_layout_container" />',
|
||||
selector: 'ul#noty_topCenter_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
top: 20,
|
||||
left: 0,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
$(this).css({
|
||||
left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px'
|
||||
});
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
43
pypowerdns/static/js/noty/layouts/topLeft.js
Normal file
43
pypowerdns/static/js/noty/layouts/topLeft.js
Normal file
@ -0,0 +1,43 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.topLeft = {
|
||||
name: 'topLeft',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_topLeft_layout_container" />',
|
||||
selector: 'ul#noty_topLeft_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
top: 20,
|
||||
left: 20,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
if (window.innerWidth < 600) {
|
||||
$(this).css({
|
||||
left: 5
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
43
pypowerdns/static/js/noty/layouts/topRight.js
Normal file
43
pypowerdns/static/js/noty/layouts/topRight.js
Normal file
@ -0,0 +1,43 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.layouts.topRight = {
|
||||
name: 'topRight',
|
||||
options: { // overrides options
|
||||
|
||||
},
|
||||
container: {
|
||||
object: '<ul id="noty_topRight_layout_container" />',
|
||||
selector: 'ul#noty_topRight_layout_container',
|
||||
style: function() {
|
||||
$(this).css({
|
||||
top: 20,
|
||||
right: 20,
|
||||
position: 'fixed',
|
||||
width: '310px',
|
||||
height: 'auto',
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
listStyleType: 'none',
|
||||
zIndex: 10000000
|
||||
});
|
||||
|
||||
if (window.innerWidth < 600) {
|
||||
$(this).css({
|
||||
right: 5
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
parent: {
|
||||
object: '<li />',
|
||||
selector: 'li',
|
||||
css: {}
|
||||
},
|
||||
css: {
|
||||
display: 'none',
|
||||
width: '310px'
|
||||
},
|
||||
addClass: ''
|
||||
};
|
||||
|
||||
})(jQuery);
|
432
pypowerdns/static/js/noty/promise.js
Normal file
432
pypowerdns/static/js/noty/promise.js
Normal file
@ -0,0 +1,432 @@
|
||||
/*!
|
||||
* Noty Helpers Javascript From JQuery Javascript Library
|
||||
*
|
||||
* Ported by Maksim Pecherskiy. Original Licensing:
|
||||
*
|
||||
* http://jquery.com/
|
||||
*
|
||||
* Copyright 2011, John Resig
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Includes Sizzle.js
|
||||
* http://sizzlejs.com/
|
||||
* Copyright 2011, The Dojo Foundation
|
||||
* Released under the MIT, BSD, and GPL Licenses.
|
||||
*
|
||||
* Date: Mon Nov 21 21:11:03 2011 -0500
|
||||
*/
|
||||
|
||||
|
||||
(function(){
|
||||
|
||||
// String to Object flags format cache
|
||||
var flagsCache = {};
|
||||
|
||||
// Convert String-formatted flags into Object-formatted ones and store in cache
|
||||
function createFlags( flags ) {
|
||||
var object = flagsCache[ flags ] = {},
|
||||
i, length;
|
||||
flags = flags.split( /\s+/ );
|
||||
for ( i = 0, length = flags.length; i < length; i++ ) {
|
||||
object[ flags[i] ] = true;
|
||||
}
|
||||
return object;
|
||||
}
|
||||
|
||||
jQuery.extend({
|
||||
|
||||
_mark: function( elem, type ) {
|
||||
if ( elem ) {
|
||||
type = (type || "fx") + "mark";
|
||||
jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
|
||||
}
|
||||
},
|
||||
|
||||
_unmark: function( force, elem, type ) {
|
||||
if ( force !== true ) {
|
||||
type = elem;
|
||||
elem = force;
|
||||
force = false;
|
||||
}
|
||||
if ( elem ) {
|
||||
type = type || "fx";
|
||||
var key = type + "mark",
|
||||
count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
|
||||
if ( count ) {
|
||||
jQuery.data( elem, key, count, true );
|
||||
} else {
|
||||
jQuery.removeData( elem, key, true );
|
||||
handleQueueMarkDefer( elem, type, "mark" );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
queue: function( elem, type, data ) {
|
||||
if ( elem ) {
|
||||
type = (type || "fx") + "queue";
|
||||
var q = jQuery.data( elem, type, undefined, true );
|
||||
// Speed up dequeue by getting out quickly if this is just a lookup
|
||||
if ( data ) {
|
||||
if ( !q || jQuery.isArray(data) ) {
|
||||
q = jQuery.data( elem, type, jQuery.makeArray(data), true );
|
||||
} else {
|
||||
q.push( data );
|
||||
}
|
||||
}
|
||||
return q || [];
|
||||
}
|
||||
},
|
||||
|
||||
dequeue: function( elem, type ) {
|
||||
type = type || "fx";
|
||||
|
||||
var queue = jQuery.queue( elem, type ),
|
||||
fn = queue.shift(),
|
||||
defer;
|
||||
|
||||
// If the fx queue is dequeued, always remove the progress sentinel
|
||||
if ( fn === "inprogress" ) {
|
||||
fn = queue.shift();
|
||||
}
|
||||
|
||||
if ( fn ) {
|
||||
// Add a progress sentinel to prevent the fx queue from being
|
||||
// automatically dequeued
|
||||
if ( type === "fx" ) {
|
||||
queue.unshift("inprogress");
|
||||
}
|
||||
|
||||
fn.call(elem, function() {
|
||||
jQuery.dequeue(elem, type);
|
||||
});
|
||||
}
|
||||
|
||||
if ( !queue.length ) {
|
||||
jQuery.removeData( elem, type + "queue", true );
|
||||
handleQueueMarkDefer( elem, type, "queue" );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
jQuery.fn.extend({
|
||||
queue: function( type, data ) {
|
||||
if ( typeof type !== "string" ) {
|
||||
data = type;
|
||||
type = "fx";
|
||||
}
|
||||
|
||||
if ( data === undefined ) {
|
||||
return jQuery.queue( this[0], type );
|
||||
}
|
||||
return this.each(function() {
|
||||
var queue = jQuery.queue( this, type, data );
|
||||
|
||||
if ( type === "fx" && queue[0] !== "inprogress" ) {
|
||||
jQuery.dequeue( this, type );
|
||||
}
|
||||
});
|
||||
},
|
||||
dequeue: function( type ) {
|
||||
return this.each(function() {
|
||||
jQuery.dequeue( this, type );
|
||||
});
|
||||
},
|
||||
// Based off of the plugin by Clint Helfers, with permission.
|
||||
// http://blindsignals.com/index.php/2009/07/jquery-delay/
|
||||
delay: function( time, type ) {
|
||||
time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
|
||||
type = type || "fx";
|
||||
|
||||
return this.queue( type, function() {
|
||||
var elem = this;
|
||||
setTimeout(function() {
|
||||
jQuery.dequeue( elem, type );
|
||||
}, time );
|
||||
});
|
||||
},
|
||||
clearQueue: function( type ) {
|
||||
return this.queue( type || "fx", [] );
|
||||
},
|
||||
// Get a promise resolved when queues of a certain type
|
||||
// are emptied (fx is the type by default)
|
||||
promise: function( type, object ) {
|
||||
if ( typeof type !== "string" ) {
|
||||
object = type;
|
||||
type = undefined;
|
||||
}
|
||||
type = type || "fx";
|
||||
var defer = jQuery.Deferred(),
|
||||
elements = this,
|
||||
i = elements.length,
|
||||
count = 1,
|
||||
deferDataKey = type + "defer",
|
||||
queueDataKey = type + "queue",
|
||||
markDataKey = type + "mark",
|
||||
tmp;
|
||||
function resolve() {
|
||||
if ( !( --count ) ) {
|
||||
defer.resolveWith( elements, [ elements ] );
|
||||
}
|
||||
}
|
||||
while( i-- ) {
|
||||
if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
|
||||
( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
|
||||
jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
|
||||
jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
|
||||
count++;
|
||||
tmp.done( resolve );
|
||||
}
|
||||
}
|
||||
resolve();
|
||||
return defer.promise();
|
||||
}
|
||||
});
|
||||
|
||||
function handleQueueMarkDefer( elem, type, src ) {
|
||||
var deferDataKey = type + "defer",
|
||||
queueDataKey = type + "queue",
|
||||
markDataKey = type + "mark",
|
||||
defer = jQuery._data( elem, deferDataKey );
|
||||
if ( defer &&
|
||||
( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
|
||||
( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
|
||||
// Give room for hard-coded callbacks to fire first
|
||||
// and eventually mark/queue something else on the element
|
||||
setTimeout( function() {
|
||||
if ( !jQuery._data( elem, queueDataKey ) &&
|
||||
!jQuery._data( elem, markDataKey ) ) {
|
||||
jQuery.removeData( elem, deferDataKey, true );
|
||||
defer.fire();
|
||||
}
|
||||
}, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
jQuery.Callbacks = function( flags ) {
|
||||
|
||||
// Convert flags from String-formatted to Object-formatted
|
||||
// (we check in cache first)
|
||||
flags = flags ? ( /*flagsCache[ flags ] || */createFlags( flags ) ) : {};
|
||||
|
||||
var // Actual callback list
|
||||
list = [],
|
||||
// Stack of fire calls for repeatable lists
|
||||
stack = [],
|
||||
// Last fire value (for non-forgettable lists)
|
||||
memory,
|
||||
// Flag to know if list is currently firing
|
||||
firing,
|
||||
// First callback to fire (used internally by add and fireWith)
|
||||
firingStart,
|
||||
// End of the loop when firing
|
||||
firingLength,
|
||||
// Index of currently firing callback (modified by remove if needed)
|
||||
firingIndex,
|
||||
// Add one or several callbacks to the list
|
||||
add = function( args ) {
|
||||
var i,
|
||||
length,
|
||||
elem,
|
||||
type,
|
||||
actual;
|
||||
for ( i = 0, length = args.length; i < length; i++ ) {
|
||||
elem = args[ i ];
|
||||
type = jQuery.type( elem );
|
||||
if ( type === "array" ) {
|
||||
// Inspect recursively
|
||||
add( elem );
|
||||
} else if ( type === "function" ) {
|
||||
// Add if not in unique mode and callback is not in
|
||||
if ( !flags.unique || !self.has( elem ) ) {
|
||||
list.push( elem );
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// Fire callbacks
|
||||
fire = function( context, args ) {
|
||||
args = args || [];
|
||||
memory = !flags.memory || [ context, args ];
|
||||
firing = true;
|
||||
firingIndex = firingStart || 0;
|
||||
firingStart = 0;
|
||||
firingLength = list.length;
|
||||
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
|
||||
if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
|
||||
memory = true; // Mark as halted
|
||||
break;
|
||||
}
|
||||
}
|
||||
firing = false;
|
||||
if ( list ) {
|
||||
if ( !flags.once ) {
|
||||
if ( stack && stack.length ) {
|
||||
memory = stack.shift();
|
||||
self.fireWith( memory[ 0 ], memory[ 1 ] );
|
||||
}
|
||||
} else if ( memory === true ) {
|
||||
self.disable();
|
||||
} else {
|
||||
list = [];
|
||||
}
|
||||
}
|
||||
},
|
||||
// Actual Callbacks object
|
||||
self = {
|
||||
// Add a callback or a collection of callbacks to the list
|
||||
add: function() {
|
||||
if ( list ) {
|
||||
var length = list.length;
|
||||
add( arguments );
|
||||
// Do we need to add the callbacks to the
|
||||
// current firing batch?
|
||||
if ( firing ) {
|
||||
firingLength = list.length;
|
||||
// With memory, if we're not firing then
|
||||
// we should call right away, unless previous
|
||||
// firing was halted (stopOnFalse)
|
||||
} else if ( memory && memory !== true ) {
|
||||
firingStart = length;
|
||||
fire( memory[ 0 ], memory[ 1 ] );
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
// Remove a callback from the list
|
||||
remove: function() {
|
||||
if ( list ) {
|
||||
var args = arguments,
|
||||
argIndex = 0,
|
||||
argLength = args.length;
|
||||
for ( ; argIndex < argLength ; argIndex++ ) {
|
||||
for ( var i = 0; i < list.length; i++ ) {
|
||||
if ( args[ argIndex ] === list[ i ] ) {
|
||||
// Handle firingIndex and firingLength
|
||||
if ( firing ) {
|
||||
if ( i <= firingLength ) {
|
||||
firingLength--;
|
||||
if ( i <= firingIndex ) {
|
||||
firingIndex--;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Remove the element
|
||||
list.splice( i--, 1 );
|
||||
// If we have some unicity property then
|
||||
// we only need to do this once
|
||||
if ( flags.unique ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
// Control if a given callback is in the list
|
||||
has: function( fn ) {
|
||||
if ( list ) {
|
||||
var i = 0,
|
||||
length = list.length;
|
||||
for ( ; i < length; i++ ) {
|
||||
if ( fn === list[ i ] ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
// Remove all callbacks from the list
|
||||
empty: function() {
|
||||
list = [];
|
||||
return this;
|
||||
},
|
||||
// Have the list do nothing anymore
|
||||
disable: function() {
|
||||
list = stack = memory = undefined;
|
||||
return this;
|
||||
},
|
||||
// Is it disabled?
|
||||
disabled: function() {
|
||||
return !list;
|
||||
},
|
||||
// Lock the list in its current state
|
||||
lock: function() {
|
||||
stack = undefined;
|
||||
if ( !memory || memory === true ) {
|
||||
self.disable();
|
||||
}
|
||||
return this;
|
||||
},
|
||||
// Is it locked?
|
||||
locked: function() {
|
||||
return !stack;
|
||||
},
|
||||
// Call all callbacks with the given context and arguments
|
||||
fireWith: function( context, args ) {
|
||||
if ( stack ) {
|
||||
if ( firing ) {
|
||||
if ( !flags.once ) {
|
||||
stack.push( [ context, args ] );
|
||||
}
|
||||
} else if ( !( flags.once && memory ) ) {
|
||||
fire( context, args );
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
// Call all the callbacks with the given arguments
|
||||
fire: function() {
|
||||
self.fireWith( this, arguments );
|
||||
return this;
|
||||
},
|
||||
// To know if the callbacks have already been called at least once
|
||||
fired: function() {
|
||||
return !!memory;
|
||||
}
|
||||
};
|
||||
|
||||
return self;
|
||||
};
|
||||
|
||||
|
||||
|
||||
jQuery.fn.extend({
|
||||
// Get a promise resolved when queues of a certain type
|
||||
// are emptied (fx is the type by default)
|
||||
promise: function( type, object ) {
|
||||
if ( typeof type !== "string" ) {
|
||||
object = type;
|
||||
type = undefined;
|
||||
}
|
||||
type = type || "fx";
|
||||
var defer = jQuery.Deferred(),
|
||||
elements = this,
|
||||
i = elements.length,
|
||||
count = 1,
|
||||
deferDataKey = type + "defer",
|
||||
queueDataKey = type + "queue",
|
||||
markDataKey = type + "mark",
|
||||
tmp;
|
||||
function resolve() {
|
||||
if ( !( --count ) ) {
|
||||
defer.resolveWith( elements, [ elements ] );
|
||||
}
|
||||
}
|
||||
while( i-- ) {
|
||||
if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
|
||||
( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
|
||||
jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
|
||||
jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
|
||||
count++;
|
||||
tmp.add( resolve );
|
||||
}
|
||||
}
|
||||
resolve();
|
||||
return defer.promise();
|
||||
}
|
||||
});
|
||||
})();
|
156
pypowerdns/static/js/noty/themes/default.js
Normal file
156
pypowerdns/static/js/noty/themes/default.js
Normal file
@ -0,0 +1,156 @@
|
||||
;(function($) {
|
||||
|
||||
$.noty.themes.defaultTheme = {
|
||||
name: 'defaultTheme',
|
||||
helpers: {
|
||||
borderFix: function() {
|
||||
if (this.options.dismissQueue) {
|
||||
var selector = this.options.layout.container.selector + ' ' + this.options.layout.parent.selector;
|
||||
switch (this.options.layout.name) {
|
||||
case 'top':
|
||||
$(selector).css({borderRadius: '0px 0px 0px 0px'});
|
||||
$(selector).last().css({borderRadius: '0px 0px 5px 5px'}); break;
|
||||
case 'topCenter': case 'topLeft': case 'topRight':
|
||||
case 'bottomCenter': case 'bottomLeft': case 'bottomRight':
|
||||
case 'center': case 'centerLeft': case 'centerRight': case 'inline':
|
||||
$(selector).css({borderRadius: '0px 0px 0px 0px'});
|
||||
$(selector).first().css({'border-top-left-radius': '5px', 'border-top-right-radius': '5px'});
|
||||
$(selector).last().css({'border-bottom-left-radius': '5px', 'border-bottom-right-radius': '5px'}); break;
|
||||
case 'bottom':
|
||||
$(selector).css({borderRadius: '0px 0px 0px 0px'});
|
||||
$(selector).first().css({borderRadius: '5px 5px 0px 0px'}); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
modal: {
|
||||
css: {
|
||||
position: 'fixed',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
backgroundColor: '#000',
|
||||
zIndex: 10000,
|
||||
opacity: 0.6,
|
||||
display: 'none',
|
||||
left: 0,
|
||||
top: 0
|
||||
}
|
||||
},
|
||||
style: function() {
|
||||
|
||||
this.$bar.css({
|
||||
overflow: 'hidden',
|
||||
background: "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAoCAYAAAAPOoFWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPZJREFUeNq81tsOgjAMANB2ov7/7ypaN7IlIwi9rGuT8QSc9EIDAsAznxvY4pXPKr05RUE5MEVB+TyWfCEl9LZApYopCmo9C4FKSMtYoI8Bwv79aQJU4l6hXXCZrQbokJEksxHo9KMOgc6w1atHXM8K9DVC7FQnJ0i8iK3QooGgbnyKgMDygBWyYFZoqx4qS27KqLZJjA1D0jK6QJcYEQEiWv9PGkTsbqxQ8oT+ZtZB6AkdsJnQDnMoHXHLGKOgDYuCWmYhEERCI5gaamW0bnHdA3k2ltlIN+2qKRyCND0bhqSYCyTB3CAOc4WusBEIpkeBuPgJMAAX8Hs1NfqHRgAAAABJRU5ErkJggg==') repeat-x scroll left top #fff"
|
||||
});
|
||||
|
||||
this.$message.css({
|
||||
fontSize: '13px',
|
||||
lineHeight: '16px',
|
||||
textAlign: 'center',
|
||||
padding: '8px 10px 9px',
|
||||
width: 'auto',
|
||||
position: 'relative'
|
||||
});
|
||||
|
||||
this.$closeButton.css({
|
||||
position: 'absolute',
|
||||
top: 4, right: 4,
|
||||
width: 10, height: 10,
|
||||
background: "url(data:image/png;base64,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)",
|
||||
display: 'none',
|
||||
cursor: 'pointer'
|
||||
});
|
||||
|
||||
this.$buttons.css({
|
||||
padding: 5,
|
||||
textAlign: 'right',
|
||||
borderTop: '1px solid #ccc',
|
||||
backgroundColor: '#fff'
|
||||
});
|
||||
|
||||
this.$buttons.find('button').css({
|
||||
marginLeft: 5
|
||||
});
|
||||
|
||||
this.$buttons.find('button:first').css({
|
||||
marginLeft: 0
|
||||
});
|
||||
|
||||
this.$bar.bind({
|
||||
mouseenter: function() { $(this).find('.noty_close').fadeIn(); },
|
||||
mouseleave: function() { $(this).find('.noty_close').fadeOut(); }
|
||||
});
|
||||
|
||||
switch (this.options.layout.name) {
|
||||
case 'top':
|
||||
this.$bar.css({
|
||||
borderRadius: '0px 0px 5px 5px',
|
||||
borderBottom: '2px solid #eee',
|
||||
borderLeft: '2px solid #eee',
|
||||
borderRight: '2px solid #eee',
|
||||
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
|
||||
});
|
||||
break;
|
||||
case 'topCenter': case 'center': case 'bottomCenter': case 'inline':
|
||||
this.$bar.css({
|
||||
borderRadius: '5px',
|
||||
border: '1px solid #eee',
|
||||
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
|
||||
});
|
||||
this.$message.css({fontSize: '13px', textAlign: 'center'});
|
||||
break;
|
||||
case 'topLeft': case 'topRight':
|
||||
case 'bottomLeft': case 'bottomRight':
|
||||
case 'centerLeft': case 'centerRight':
|
||||
this.$bar.css({
|
||||
borderRadius: '5px',
|
||||
border: '1px solid #eee',
|
||||
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
|
||||
});
|
||||
this.$message.css({fontSize: '13px', textAlign: 'left'});
|
||||
break;
|
||||
case 'bottom':
|
||||
this.$bar.css({
|
||||
borderRadius: '5px 5px 0px 0px',
|
||||
borderTop: '2px solid #eee',
|
||||
borderLeft: '2px solid #eee',
|
||||
borderRight: '2px solid #eee',
|
||||
boxShadow: "0 -2px 4px rgba(0, 0, 0, 0.1)"
|
||||
});
|
||||
break;
|
||||
default:
|
||||
this.$bar.css({
|
||||
border: '2px solid #eee',
|
||||
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
switch (this.options.type) {
|
||||
case 'alert': case 'notification':
|
||||
this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'}); break;
|
||||
case 'warning':
|
||||
this.$bar.css({backgroundColor: '#FFEAA8', borderColor: '#FFC237', color: '#826200'});
|
||||
this.$buttons.css({borderTop: '1px solid #FFC237'}); break;
|
||||
case 'error':
|
||||
this.$bar.css({backgroundColor: 'red', borderColor: 'darkred', color: '#FFF'});
|
||||
this.$message.css({fontWeight: 'bold'});
|
||||
this.$buttons.css({borderTop: '1px solid darkred'}); break;
|
||||
case 'information':
|
||||
this.$bar.css({backgroundColor: '#57B7E2', borderColor: '#0B90C4', color: '#FFF'});
|
||||
this.$buttons.css({borderTop: '1px solid #0B90C4'}); break;
|
||||
case 'success':
|
||||
this.$bar.css({backgroundColor: 'lightgreen', borderColor: '#50C24E', color: 'darkgreen'});
|
||||
this.$buttons.css({borderTop: '1px solid #50C24E'});break;
|
||||
default:
|
||||
this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'}); break;
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
onShow: function() { $.noty.themes.defaultTheme.helpers.borderFix.apply(this); },
|
||||
onClose: function() { $.noty.themes.defaultTheme.helpers.borderFix.apply(this); }
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
@ -0,0 +1,48 @@
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<title>{{ titulo }}</title>
|
||||
|
||||
{% block cabecalho %}
|
||||
|
||||
<script type=text/javascript src="{{ url_for('static', filename='js/jquery-1.8.3.min.js') }}"></script>
|
||||
|
||||
<!-- Acerta padroes de formulario -->
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/formalize.css') }}" />
|
||||
<script type=text/javascript src="{{ url_for('static', filename='js/jquery.formalize.min.js') }}"></script>
|
||||
|
||||
<!-- Popup´s de notificacao -->
|
||||
<script type=text/javascript src="{{ url_for('static', filename='js/noty/jquery.noty.js') }}"></script>
|
||||
<script type=text/javascript src="{{ url_for('static', filename='js/noty/layouts/topCenter.js') }}"></script>
|
||||
<script type=text/javascript src="{{ url_for('static', filename='js/noty/themes/default.js') }}"></script>
|
||||
<script type=text/javascript>
|
||||
$(document).ready(function() {
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
{% if category == "erro" %}
|
||||
noty({
|
||||
text: '<img src="/static/img/dialog-error.png" style="vertical-align: middle; margin-right: 8px;" /> {{ message }}',
|
||||
layout: 'topCenter',
|
||||
type: 'alert',
|
||||
timeout: (2 * 1000),
|
||||
modal: true
|
||||
});
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{% block conteudo %}
|
||||
{% endblock %}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,8 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Tela de Login</title>
|
||||
</head>
|
||||
<body>
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block conteudo %}
|
||||
|
||||
<form method="POST" action="/login">
|
||||
{{ form.hidden_tag() }}
|
||||
@ -15,5 +13,4 @@
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
{% endblock %}
|
@ -32,7 +32,8 @@ login_manager.setup_app(app)
|
||||
@app.route('/login', methods=['GET', 'POST'])
|
||||
def login():
|
||||
form = FormLogin(request.form)
|
||||
if request.method == 'POST' and form.validate():
|
||||
if request.method == 'POST':
|
||||
if form.validate():
|
||||
_login = request.form['login']
|
||||
_senha = request.form['senha']
|
||||
|
||||
@ -42,10 +43,13 @@ def login():
|
||||
login_user(User(_em_db.login, _em_db.id))
|
||||
redirect(request.args.get("next") or url_for("index"))
|
||||
else:
|
||||
flash(unicode("Senha Invalida", "UTF-8"))
|
||||
flash(unicode("Senha Invalida", "utf8"), "erro")
|
||||
return render_template("login.html", form=form)
|
||||
else:
|
||||
flash(unicode("Usuário não existe", "UTF-8"))
|
||||
flash(unicode("Usuário não existe", "utf8"), "erro")
|
||||
return render_template("login.html", form=form)
|
||||
else:
|
||||
flash(unicode("Você deve preencher o formulário", "utf8"), "erro")
|
||||
return render_template("login.html", form=form)
|
||||
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user