- Upgraded "PNotify" js lib v3.0.0 -> v3.2.0

This commit is contained in:
Mark Friedrich
2018-06-15 19:08:25 +02:00
parent 381ba39551
commit 63da54854b
19 changed files with 2728 additions and 2736 deletions

View File

@@ -71,7 +71,7 @@ requirejs.config({
'datatables.plugins.render.ellipsis': 'lib/datatables/plugins/render/ellipsis',
// notification plugin
pnotify: 'lib/pnotify/pnotify', // v3.0.0 PNotify - notification core file - https://sciactive.com/pnotify/
pnotify: 'lib/pnotify/pnotify', // v3.2.0 PNotify - notification core file - https://sciactive.com/pnotify/
'pnotify.buttons': 'lib/pnotify/pnotify.buttons', // PNotify - buttons notification extension
'pnotify.confirm': 'lib/pnotify/pnotify.confirm', // PNotify - confirmation notification extension
'pnotify.nonblock': 'lib/pnotify/pnotify.nonblock', // PNotify - notification non-block extension (hover effect)

View File

@@ -77,7 +77,6 @@ define([
* @param settings
*/
let showNotify = function(customConfig, settings){
customConfig = $.extend(true, {}, config, customConfig );
// desktop notification

View File

@@ -1042,7 +1042,7 @@ define([
* @param value
* @returns {*}
*/
let getCurrentTriggerDelay = function( updateKey, value ){
let getCurrentTriggerDelay = (updateKey, value ) => {
// make sure the delay timer is valid!
// if this is called for the first time -> set CURRENT_DELAY
@@ -1068,7 +1068,7 @@ define([
* get date obj with current EVE Server Time.
* @returns {Date}
*/
let getServerTime = function(){
let getServerTime = () => {
// Server is running with GMT/UTC (EVE Time)
let localDate = new Date();
@@ -1090,7 +1090,7 @@ define([
* @param timestamp
* @returns {Date}
*/
let convertTimestampToServerTime = function(timestamp){
let convertTimestampToServerTime = timestamp => {
let currentTimeZoneOffsetInMinutes = new Date().getTimezoneOffset();
return new Date( (timestamp + (currentTimeZoneOffsetInMinutes * 60)) * 1000);
};
@@ -1101,7 +1101,7 @@ define([
* @param date2
* @returns {{}}
*/
let getTimeDiffParts = function(date1, date2){
let getTimeDiffParts = (date1, date2) => {
let parts = {};
let time1 = date1.getTime();
let time2 = date2.getTime();
@@ -1131,7 +1131,7 @@ define([
* start time measurement by a unique string identifier
* @param timerName
*/
let timeStart = function(timerName){
let timeStart = timerName => {
if(typeof performance === 'object'){
stopTimerCache[timerName] = performance.now();
@@ -1145,7 +1145,7 @@ define([
* @param timerName
* @returns {number}
*/
let timeStop = function(timerName){
let timeStop = timerName => {
let duration = 0;
@@ -1175,7 +1175,7 @@ define([
* @param charCounterElement
* @param maxCharLength
*/
let updateCounter = function(field, charCounterElement, maxCharLength){
let updateCounter = (field, charCounterElement, maxCharLength) => {
let value = field.val();
let inputLength = value.length;
@@ -1201,7 +1201,7 @@ define([
* @param logKey
* @param options
*/
let log = function(logKey, options){
let log = (logKey, options) => {
$(window).trigger('pf:log', [logKey, options]);
};
@@ -1210,8 +1210,8 @@ define([
* @param customConfig
* @param desktop
*/
let showNotify = function(customConfig, desktop){
requirejs(['notification'], function(Notification) {
let showNotify = (customConfig, desktop) => {
requirejs(['notification'], Notification => {
Notification.showNotify(customConfig, desktop);
});
};
@@ -1231,7 +1231,7 @@ define([
* @param option
* @returns {string}
*/
let getLogInfo = function(logType, option){
let getLogInfo = (logType, option) => {
let logInfo = '';
if(Init.classes.logTypes.hasOwnProperty(logType)){

View File

@@ -1,176 +1,164 @@
// Buttons
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.buttons', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.buttons', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
}
}(typeof window !== "undefined" ? window : this, function($, PNotify){
PNotify.prototype.options.buttons = {
// Provide a button for the user to manually close the notice.
closer: true,
// Only show the closer button on hover.
closer_hover: true,
// Provide a button for the user to manually stick the notice.
sticker: true,
// Only show the sticker button on hover.
sticker_hover: true,
// Show the buttons even when the nonblock module is in use.
show_on_nonblock: false,
// The various displayed text, helps facilitating internationalization.
labels: {
close: "Close",
stick: "Stick",
unstick: "Unstick"
},
// The classes to use for button icons. Leave them null to use the classes from the styling you're using.
classes: {
closer: null,
pin_up: null,
pin_down: null
}
}(this, function($, PNotify){
PNotify.prototype.options.buttons = {
// Provide a button for the user to manually close the notice.
closer: true,
// Only show the closer button on hover.
closer_hover: true,
// Provide a button for the user to manually stick the notice.
sticker: true,
// Only show the sticker button on hover.
sticker_hover: true,
// Show the buttons even when the nonblock module is in use.
show_on_nonblock: false,
// The various displayed text, helps facilitating internationalization.
labels: {
close: "Close",
stick: "Stick",
unstick: "Unstick"
};
PNotify.prototype.modules.buttons = {
init: function(notice, options){
var that = this;
notice.elem.on({
"mouseenter": function(e){
// Show the buttons.
if (that.options.sticker && (!(notice.options.nonblock && notice.options.nonblock.nonblock) || that.options.show_on_nonblock)) {
that.sticker.trigger("pnotify:buttons:toggleStick").css("visibility", "visible");
}
if (that.options.closer && (!(notice.options.nonblock && notice.options.nonblock.nonblock) || that.options.show_on_nonblock)) {
that.closer.css("visibility", "visible");
}
},
// The classes to use for button icons. Leave them null to use the classes from the styling you're using.
classes: {
closer: null,
pin_up: null,
pin_down: null
"mouseleave": function(e){
// Hide the buttons.
if (that.options.sticker_hover) {
that.sticker.css("visibility", "hidden");
}
if (that.options.closer_hover) {
that.closer.css("visibility", "hidden");
}
}
};
PNotify.prototype.modules.buttons = {
closer: null,
sticker: null,
});
init: function(notice, options){
var that = this;
notice.elem.on({
"mouseenter": function(e){
// Show the buttons.
if (that.options.sticker && (!(notice.options.nonblock && notice.options.nonblock.nonblock) || that.options.show_on_nonblock)) {
that.sticker.trigger("pnotify:buttons:toggleStick").css("visibility", "visible");
}
if (that.options.closer && (!(notice.options.nonblock && notice.options.nonblock.nonblock) || that.options.show_on_nonblock)) {
that.closer.css("visibility", "visible");
}
},
"mouseleave": function(e){
// Hide the buttons.
if (that.options.sticker_hover) {
that.sticker.css("visibility", "hidden");
}
if (that.options.closer_hover) {
that.closer.css("visibility", "hidden");
}
}
});
// Provide a button to stick the notice.
this.sticker = $("<div />", {
"class": "ui-pnotify-sticker",
"aria-role": "button",
"aria-pressed": notice.options.hide ? "false" : "true",
"tabindex": "0",
"title": notice.options.hide ? options.labels.stick : options.labels.unstick,
"css": {
"cursor": "pointer",
"visibility": options.sticker_hover ? "hidden" : "visible"
},
"click": function(){
notice.options.hide = !notice.options.hide;
if (notice.options.hide) {
notice.queueRemove();
} else {
notice.cancelRemove();
}
$(this).trigger("pnotify:buttons:toggleStick");
}
})
.bind("pnotify:buttons:toggleStick", function(){
var pin_up = that.options.classes.pin_up === null ? notice.styles.pin_up : that.options.classes.pin_up;
var pin_down = that.options.classes.pin_down === null ? notice.styles.pin_down : that.options.classes.pin_down;
$(this)
.attr("title", notice.options.hide ? that.options.labels.stick : that.options.labels.unstick)
.children()
.attr("class", "")
.addClass(notice.options.hide ? pin_up : pin_down)
.attr("aria-pressed", notice.options.hide ? "false" : "true");
})
.append("<span />")
.trigger("pnotify:buttons:toggleStick")
.prependTo(notice.container);
if (!options.sticker || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.sticker.css("display", "none");
}
// Provide a button to close the notice.
this.closer = $("<div />", {
"class": "ui-pnotify-closer",
"aria-role": "button",
"tabindex": "0",
"title": options.labels.close,
"css": {"cursor": "pointer", "visibility": options.closer_hover ? "hidden" : "visible"},
"click": function(){
notice.remove(false);
that.sticker.css("visibility", "hidden");
that.closer.css("visibility", "hidden");
}
})
.append($("<span />", {"class": options.classes.closer === null ? notice.styles.closer : options.classes.closer}))
.prependTo(notice.container);
if (!options.closer || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.closer.css("display", "none");
}
// Provide a button to stick the notice.
this.sticker = $("<div />", {
"class": "ui-pnotify-sticker",
"aria-role": "button",
"aria-pressed": notice.options.hide ? "false" : "true",
"tabindex": "0",
"title": notice.options.hide ? options.labels.stick : options.labels.unstick,
"css": {
"cursor": "pointer",
"visibility": options.sticker_hover ? "hidden" : "visible"
},
update: function(notice, options){
// Update the sticker and closer buttons.
if (!options.closer || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.closer.css("display", "none");
} else if (options.closer) {
this.closer.css("display", "block");
}
if (!options.sticker || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.sticker.css("display", "none");
} else if (options.sticker) {
this.sticker.css("display", "block");
}
// Update the sticker icon.
this.sticker.trigger("pnotify:buttons:toggleStick");
// Update the close icon.
this.closer.find("span").attr("class", "").addClass(options.classes.closer === null ? notice.styles.closer : options.classes.closer);
// Update the hover status of the buttons.
if (options.sticker_hover) {
this.sticker.css("visibility", "hidden");
} else if (!(notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.sticker.css("visibility", "visible");
}
if (options.closer_hover) {
this.closer.css("visibility", "hidden");
} else if (!(notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.closer.css("visibility", "visible");
}
"click": function(){
notice.options.hide = !notice.options.hide;
if (notice.options.hide) {
notice.queueRemove();
} else {
notice.cancelRemove();
}
$(this).trigger("pnotify:buttons:toggleStick");
}
};
$.extend(PNotify.styling.brighttheme, {
closer: "brighttheme-icon-closer",
pin_up: "brighttheme-icon-sticker",
pin_down: "brighttheme-icon-sticker brighttheme-icon-stuck"
});
$.extend(PNotify.styling.jqueryui, {
closer: "ui-icon ui-icon-close",
pin_up: "ui-icon ui-icon-pin-w",
pin_down: "ui-icon ui-icon-pin-s"
});
$.extend(PNotify.styling.bootstrap2, {
closer: "icon-remove",
pin_up: "icon-pause",
pin_down: "icon-play"
});
$.extend(PNotify.styling.bootstrap3, {
closer: "glyphicon glyphicon-remove",
pin_up: "glyphicon glyphicon-pause",
pin_down: "glyphicon glyphicon-play"
});
$.extend(PNotify.styling.fontawesome, {
closer: "fas fa-times",
pin_up: "fas fa-pause",
pin_down: "fas fa-play"
});
})
.bind("pnotify:buttons:toggleStick", function(){
var pin_up = that.options.classes.pin_up === null ? notice.styles.pin_up : that.options.classes.pin_up;
var pin_down = that.options.classes.pin_down === null ? notice.styles.pin_down : that.options.classes.pin_down;
$(this)
.attr("title", notice.options.hide ? that.options.labels.stick : that.options.labels.unstick)
.children()
.attr("class", "")
.addClass(notice.options.hide ? pin_up : pin_down)
.attr("aria-pressed", notice.options.hide ? "false" : "true");
})
.append("<span />")
.trigger("pnotify:buttons:toggleStick")
.prependTo(notice.container);
if (!options.sticker || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.sticker.css("display", "none");
}
// Provide a button to close the notice.
this.closer = $("<div />", {
"class": "ui-pnotify-closer",
"aria-role": "button",
"tabindex": "0",
"title": options.labels.close,
"css": {"cursor": "pointer", "visibility": options.closer_hover ? "hidden" : "visible"},
"click": function(){
notice.remove(false);
that.sticker.css("visibility", "hidden");
that.closer.css("visibility", "hidden");
}
})
.append($("<span />", {"class": options.classes.closer === null ? notice.styles.closer : options.classes.closer}))
.prependTo(notice.container);
if (!options.closer || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.closer.css("display", "none");
}
},
update: function(notice, options){
// Update the sticker and closer buttons.
if (!options.closer || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.closer.css("display", "none");
} else if (options.closer) {
this.closer.css("display", "block");
}
if (!options.sticker || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.sticker.css("display", "none");
} else if (options.sticker) {
this.sticker.css("display", "block");
}
// Update the sticker icon.
this.sticker.trigger("pnotify:buttons:toggleStick");
// Update the close icon.
this.closer.find("span").attr("class", "").addClass(options.classes.closer === null ? notice.styles.closer : options.classes.closer);
// Update the hover status of the buttons.
if (options.sticker_hover) {
this.sticker.css("visibility", "hidden");
} else if (!(notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.sticker.css("visibility", "visible");
}
if (options.closer_hover) {
this.closer.css("visibility", "hidden");
} else if (!(notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.closer.css("visibility", "visible");
}
}
};
$.extend(PNotify.styling.brighttheme, {
closer: "brighttheme-icon-closer",
pin_up: "brighttheme-icon-sticker",
pin_down: "brighttheme-icon-sticker brighttheme-icon-stuck"
});
$.extend(PNotify.styling.bootstrap3, {
closer: "glyphicon glyphicon-remove",
pin_up: "glyphicon glyphicon-pause",
pin_down: "glyphicon glyphicon-play"
});
$.extend(PNotify.styling.fontawesome, {
closer: "fa fa-times",
pin_up: "fa fa-pause",
pin_down: "fa fa-play"
});
return PNotify;
}));

View File

@@ -1,50 +1,51 @@
// Callbacks
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.callbacks', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
}
}(this, function($, PNotify){
var _init = PNotify.prototype.init,
_open = PNotify.prototype.open,
_remove = PNotify.prototype.remove;
PNotify.prototype.init = function(){
if (this.options.before_init) {
this.options.before_init(this.options);
}
_init.apply(this, arguments);
if (this.options.after_init) {
this.options.after_init(this);
}
};
PNotify.prototype.open = function(){
var ret;
if (this.options.before_open) {
ret = this.options.before_open(this);
}
if (ret !== false) {
_open.apply(this, arguments);
if (this.options.after_open) {
this.options.after_open(this);
}
}
};
PNotify.prototype.remove = function(timer_hide){
var ret;
if (this.options.before_close) {
ret = this.options.before_close(this, timer_hide);
}
if (ret !== false) {
_remove.apply(this, arguments);
if (this.options.after_close) {
this.options.after_close(this, timer_hide);
}
}
};
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.callbacks', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
}
}(typeof window !== "undefined" ? window : this, function($, PNotify){
var _init = PNotify.prototype.init,
_open = PNotify.prototype.open,
_remove = PNotify.prototype.remove;
PNotify.prototype.init = function(){
if (this.options.before_init) {
this.options.before_init(this.options);
}
_init.apply(this, arguments);
if (this.options.after_init) {
this.options.after_init(this);
}
};
PNotify.prototype.open = function(){
var ret;
if (this.options.before_open) {
ret = this.options.before_open(this);
}
if (ret !== false) {
_open.apply(this, arguments);
if (this.options.after_open) {
this.options.after_open(this);
}
}
};
PNotify.prototype.remove = function(timer_hide){
var ret;
if (this.options.before_close) {
ret = this.options.before_close(this, timer_hide);
}
if (ret !== false) {
_remove.apply(this, arguments);
if (this.options.after_close) {
this.options.after_close(this, timer_hide);
}
}
};
return PNotify;
}));

View File

@@ -1,154 +1,157 @@
// Desktop
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.desktop', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
}
}(this, function($, PNotify){
var permission;
var notify = function(title, options){
// Memoize based on feature detection.
if ("Notification" in window) {
notify = function (title, options) {
return new Notification(title, options);
};
} else if ("mozNotification" in navigator) {
notify = function (title, options) {
// Gecko < 22
return navigator.mozNotification
.createNotification(title, options.body, options.icon)
.show();
};
} else if ("webkitNotifications" in window) {
notify = function (title, options) {
return window.webkitNotifications.createNotification(
options.icon,
title,
options.body
);
};
} else {
notify = function (title, options) {
return null;
};
}
return notify(title, options);
};
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.desktop', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
}
}(typeof window !== "undefined" ? window : this, function($, PNotify){
var permission;
var notify = function(title, options){
// Memoize based on feature detection.
if ("Notification" in window) {
notify = function (title, options) {
return new Notification(title, options);
};
} else if ("mozNotification" in navigator) {
notify = function (title, options) {
// Gecko < 22
return navigator.mozNotification
.createNotification(title, options.body, options.icon)
.show();
};
} else if ("webkitNotifications" in window) {
notify = function (title, options) {
return window.webkitNotifications.createNotification(
options.icon,
title,
options.body
);
};
} else {
notify = function (title, options) {
return null;
};
}
return notify(title, options);
};
PNotify.prototype.options.desktop = {
// Display the notification as a desktop notification.
desktop: false,
// If desktop notifications are not supported or allowed, fall back to a regular notice.
fallback: true,
// The URL of the icon to display. If false, no icon will show. If null, a default icon will show.
icon: null,
// Using a tag lets you update an existing notice, or keep from duplicating notices between tabs.
// If you leave tag null, one will be generated, facilitating the "update" function.
// see: http://www.w3.org/TR/notifications/#tags-example
tag: null
};
PNotify.prototype.modules.desktop = {
tag: null,
icon: null,
genNotice: function(notice, options){
if (options.icon === null) {
this.icon = "http://sciactive.com/pnotify/includes/desktop/"+notice.options.type+".png";
} else if (options.icon === false) {
this.icon = null;
} else {
this.icon = options.icon;
}
if (this.tag === null || options.tag !== null) {
this.tag = options.tag === null ? "PNotify-"+Math.round(Math.random() * 1000000) : options.tag;
}
notice.desktop = notify(notice.options.title, {
icon: this.icon,
body: options.text || notice.options.text,
tag: this.tag
});
if (!("close" in notice.desktop) && ("cancel" in notice.desktop)) {
notice.desktop.close = function(){
notice.desktop.cancel();
};
}
notice.desktop.onclick = function(){
notice.elem.trigger("click");
};
notice.desktop.onclose = function(){
if (notice.state !== "closing" && notice.state !== "closed") {
notice.remove();
}
};
},
init: function(notice, options){
if (!options.desktop)
return;
permission = PNotify.desktop.checkPermission();
if (permission !== 0) {
// Keep the notice from opening if fallback is false.
if (!options.fallback) {
notice.options.auto_display = false;
}
return;
}
this.genNotice(notice, options);
},
update: function(notice, options, oldOpts){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
this.genNotice(notice, options);
},
beforeOpen: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
},
afterOpen: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
if ("show" in notice.desktop) {
notice.desktop.show();
}
},
beforeClose: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
},
afterClose: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
if ("close" in notice.desktop) {
notice.desktop.close();
}
}
};
PNotify.desktop = {
permission: function(){
if (typeof Notification !== "undefined" && "requestPermission" in Notification) {
Notification.requestPermission();
} else if ("webkitNotifications" in window) {
window.webkitNotifications.requestPermission();
}
},
checkPermission: function(){
if (typeof Notification !== "undefined" && "permission" in Notification) {
return (Notification.permission === "granted" ? 0 : 1);
} else if ("webkitNotifications" in window) {
return window.webkitNotifications.checkPermission() == 0 ? 0 : 1;
} else {
return 1;
}
}
};
permission = PNotify.desktop.checkPermission();
PNotify.prototype.options.desktop = {
// Display the notification as a desktop notification.
desktop: false,
// If desktop notifications are not supported or allowed, fall back to a regular notice.
fallback: true,
// The URL of the icon to display. If false, no icon will show. If null, a default icon will show.
icon: null,
// Using a tag lets you update an existing notice, or keep from duplicating notices between tabs.
// If you leave tag null, one will be generated, facilitating the "update" function.
// see: http://www.w3.org/TR/notifications/#tags-example
tag: null,
// Optionally display a different title for the desktop.
title: null,
// Optionally display different text for the desktop.
text: null
};
PNotify.prototype.modules.desktop = {
genNotice: function(notice, options){
if (options.icon === null) {
this.icon = "http://sciactive.com/pnotify/includes/desktop/"+notice.options.type+".png";
} else if (options.icon === false) {
this.icon = null;
} else {
this.icon = options.icon;
}
if (this.tag === null || options.tag !== null) {
this.tag = options.tag === null ? "PNotify-"+Math.round(Math.random() * 1000000) : options.tag;
}
notice.desktop = notify(options.title || notice.options.title, {
icon: this.icon,
body: options.text || notice.options.text,
tag: this.tag
});
if (!("close" in notice.desktop) && ("cancel" in notice.desktop)) {
notice.desktop.close = function(){
notice.desktop.cancel();
};
}
notice.desktop.onclick = function(){
notice.elem.trigger("click");
};
notice.desktop.onclose = function(){
if (notice.state !== "closing" && notice.state !== "closed") {
notice.remove();
}
};
},
init: function(notice, options){
if (!options.desktop)
return;
permission = PNotify.desktop.checkPermission();
if (permission !== 0) {
// Keep the notice from opening if fallback is false.
if (!options.fallback) {
notice.options.auto_display = false;
}
return;
}
this.genNotice(notice, options);
},
update: function(notice, options, oldOpts){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
this.genNotice(notice, options);
},
beforeOpen: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
},
afterOpen: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
if ("show" in notice.desktop) {
notice.desktop.show();
}
},
beforeClose: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
},
afterClose: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
if ("close" in notice.desktop) {
notice.desktop.close();
}
}
};
PNotify.desktop = {
permission: function(){
if (typeof Notification !== "undefined" && "requestPermission" in Notification) {
Notification.requestPermission();
} else if ("webkitNotifications" in window) {
window.webkitNotifications.requestPermission();
}
},
checkPermission: function(){
if (typeof Notification !== "undefined" && "permission" in Notification) {
return (Notification.permission === "granted" ? 0 : 1);
} else if ("webkitNotifications" in window) {
return window.webkitNotifications.checkPermission() == 0 ? 0 : 1;
} else {
return 1;
}
}
};
permission = PNotify.desktop.checkPermission();
return PNotify;
}));

File diff suppressed because it is too large Load Diff

View File

@@ -1,156 +1,157 @@
// Nonblock
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.nonblock', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
}
}(this, function($, PNotify){
// Some useful regexes.
var re_on = /^on/,
re_mouse_events = /^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/,
re_ui_events = /^(focus|blur|select|change|reset)$|^key(press|down|up)$/,
re_html_events = /^(scroll|resize|(un)?load|abort|error)$/;
// Fire a DOM event.
var dom_event = function(e, orig_e){
var event_object;
e = e.toLowerCase();
if (document.createEvent && this.dispatchEvent) {
// FireFox, Opera, Safari, Chrome
e = e.replace(re_on, '');
if (e.match(re_mouse_events)) {
// This allows the click event to fire on the notice. There is
// probably a much better way to do it.
$(this).offset();
event_object = document.createEvent("MouseEvents");
event_object.initMouseEvent(
e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail,
orig_e.screenX, orig_e.screenY, orig_e.clientX, orig_e.clientY,
orig_e.ctrlKey, orig_e.altKey, orig_e.shiftKey, orig_e.metaKey, orig_e.button, orig_e.relatedTarget
);
} else if (e.match(re_ui_events)) {
event_object = document.createEvent("UIEvents");
event_object.initUIEvent(e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail);
} else if (e.match(re_html_events)) {
event_object = document.createEvent("HTMLEvents");
event_object.initEvent(e, orig_e.bubbles, orig_e.cancelable);
}
if (!event_object) return;
this.dispatchEvent(event_object);
} else {
// Internet Explorer
if (!e.match(re_on)) e = "on"+e;
event_object = document.createEventObject(orig_e);
this.fireEvent(e, event_object);
}
};
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.nonblock', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
}
}(typeof window !== "undefined" ? window : this, function($, PNotify){
// Some useful regexes.
var re_on = /^on/,
re_mouse_events = /^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/,
re_ui_events = /^(focus|blur|select|change|reset)$|^key(press|down|up)$/,
re_html_events = /^(scroll|resize|(un)?load|abort|error)$/;
// Fire a DOM event.
var dom_event = function(e, orig_e){
var event_object;
e = e.toLowerCase();
if (document.createEvent && this.dispatchEvent) {
// FireFox, Opera, Safari, Chrome
e = e.replace(re_on, '');
if (e.match(re_mouse_events)) {
// This allows the click event to fire on the notice. There is
// probably a much better way to do it.
$(this).offset();
event_object = document.createEvent("MouseEvents");
event_object.initMouseEvent(
e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail,
orig_e.screenX, orig_e.screenY, orig_e.clientX, orig_e.clientY,
orig_e.ctrlKey, orig_e.altKey, orig_e.shiftKey, orig_e.metaKey, orig_e.button, orig_e.relatedTarget
);
} else if (e.match(re_ui_events)) {
event_object = document.createEvent("UIEvents");
event_object.initUIEvent(e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail);
} else if (e.match(re_html_events)) {
event_object = document.createEvent("HTMLEvents");
event_object.initEvent(e, orig_e.bubbles, orig_e.cancelable);
}
if (!event_object) return;
this.dispatchEvent(event_object);
} else {
// Internet Explorer
if (!e.match(re_on)) e = "on"+e;
event_object = document.createEventObject(orig_e);
this.fireEvent(e, event_object);
}
};
// This keeps track of the last element the mouse was over, so
// mouseleave, mouseenter, etc can be called.
var nonblock_last_elem;
// This is used to pass events through the notice if it is non-blocking.
var nonblock_pass = function(notice, e, e_name){
notice.elem.addClass("ui-pnotify-nonblock-hide");
var element_below = document.elementFromPoint(e.clientX, e.clientY);
notice.elem.removeClass("ui-pnotify-nonblock-hide");
var jelement_below = $(element_below);
var cursor_style = jelement_below.css("cursor");
if (cursor_style === "auto" && element_below.tagName === "A") {
cursor_style = "pointer";
}
notice.elem.css("cursor", cursor_style !== "auto" ? cursor_style : "default");
// If the element changed, call mouseenter, mouseleave, etc.
if (!nonblock_last_elem || nonblock_last_elem.get(0) != element_below) {
if (nonblock_last_elem) {
dom_event.call(nonblock_last_elem.get(0), "mouseleave", e.originalEvent);
dom_event.call(nonblock_last_elem.get(0), "mouseout", e.originalEvent);
}
dom_event.call(element_below, "mouseenter", e.originalEvent);
dom_event.call(element_below, "mouseover", e.originalEvent);
}
dom_event.call(element_below, e_name, e.originalEvent);
// Remember the latest element the mouse was over.
nonblock_last_elem = jelement_below;
};
// This keeps track of the last element the mouse was over, so
// mouseleave, mouseenter, etc can be called.
var nonblock_last_elem;
// This is used to pass events through the notice if it is non-blocking.
var nonblock_pass = function(notice, e, e_name){
notice.elem.addClass("ui-pnotify-nonblock-hide");
var element_below = document.elementFromPoint(e.clientX, e.clientY);
notice.elem.removeClass("ui-pnotify-nonblock-hide");
var jelement_below = $(element_below);
var cursor_style = jelement_below.css("cursor");
if (cursor_style === "auto" && element_below.tagName === "A") {
cursor_style = "pointer";
}
notice.elem.css("cursor", cursor_style !== "auto" ? cursor_style : "default");
// If the element changed, call mouseenter, mouseleave, etc.
if (!nonblock_last_elem || nonblock_last_elem.get(0) != element_below) {
if (nonblock_last_elem) {
dom_event.call(nonblock_last_elem.get(0), "mouseleave", e.originalEvent);
dom_event.call(nonblock_last_elem.get(0), "mouseout", e.originalEvent);
}
dom_event.call(element_below, "mouseenter", e.originalEvent);
dom_event.call(element_below, "mouseover", e.originalEvent);
}
dom_event.call(element_below, e_name, e.originalEvent);
// Remember the latest element the mouse was over.
nonblock_last_elem = jelement_below;
};
PNotify.prototype.options.nonblock = {
// Create a non-blocking notice. It lets the user click elements underneath it.
nonblock: false
};
PNotify.prototype.modules.nonblock = {
init: function(notice, options){
var that = this;
notice.elem.on({
"mouseenter": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
if (that.options.nonblock) {
// If it's non-blocking, animate to the other opacity.
notice.elem.addClass("ui-pnotify-nonblock-fade");
}
},
"mouseleave": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
nonblock_last_elem = null;
notice.elem.css("cursor", "auto");
// Animate back to the normal opacity.
if (that.options.nonblock && notice.animating !== "out") {
notice.elem.removeClass("ui-pnotify-nonblock-fade");
}
},
"mouseover": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
},
"mouseout": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
},
"mousemove": function(e){
if (that.options.nonblock) {
e.stopPropagation();
nonblock_pass(notice, e, "onmousemove");
}
},
"mousedown": function(e){
if (that.options.nonblock) {
e.stopPropagation();
e.preventDefault();
nonblock_pass(notice, e, "onmousedown");
}
},
"mouseup": function(e){
if (that.options.nonblock) {
e.stopPropagation();
e.preventDefault();
nonblock_pass(notice, e, "onmouseup");
}
},
"click": function(e){
if (that.options.nonblock) {
e.stopPropagation();
nonblock_pass(notice, e, "onclick");
}
},
"dblclick": function(e){
if (that.options.nonblock) {
e.stopPropagation();
nonblock_pass(notice, e, "ondblclick");
}
}
});
}
};
PNotify.prototype.options.nonblock = {
// Create a non-blocking notice. It lets the user click elements underneath it.
nonblock: false
};
PNotify.prototype.modules.nonblock = {
init: function(notice, options){
var that = this;
notice.elem.on({
"mouseenter": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
if (that.options.nonblock) {
// If it's non-blocking, animate to the other opacity.
notice.elem.addClass("ui-pnotify-nonblock-fade");
}
},
"mouseleave": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
nonblock_last_elem = null;
notice.elem.css("cursor", "auto");
// Animate back to the normal opacity.
if (that.options.nonblock && notice.animating !== "out") {
notice.elem.removeClass("ui-pnotify-nonblock-fade");
}
},
"mouseover": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
},
"mouseout": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
},
"mousemove": function(e){
if (that.options.nonblock) {
e.stopPropagation();
nonblock_pass(notice, e, "onmousemove");
}
},
"mousedown": function(e){
if (that.options.nonblock) {
e.stopPropagation();
e.preventDefault();
nonblock_pass(notice, e, "onmousedown");
}
},
"mouseup": function(e){
if (that.options.nonblock) {
e.stopPropagation();
e.preventDefault();
nonblock_pass(notice, e, "onmouseup");
}
},
"click": function(e){
if (that.options.nonblock) {
e.stopPropagation();
nonblock_pass(notice, e, "onclick");
}
},
"dblclick": function(e){
if (that.options.nonblock) {
e.stopPropagation();
nonblock_pass(notice, e, "ondblclick");
}
}
});
}
};
return PNotify;
}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -77,7 +77,6 @@ define([
* @param settings
*/
let showNotify = function(customConfig, settings){
customConfig = $.extend(true, {}, config, customConfig );
// desktop notification

View File

@@ -1042,7 +1042,7 @@ define([
* @param value
* @returns {*}
*/
let getCurrentTriggerDelay = function( updateKey, value ){
let getCurrentTriggerDelay = (updateKey, value ) => {
// make sure the delay timer is valid!
// if this is called for the first time -> set CURRENT_DELAY
@@ -1068,7 +1068,7 @@ define([
* get date obj with current EVE Server Time.
* @returns {Date}
*/
let getServerTime = function(){
let getServerTime = () => {
// Server is running with GMT/UTC (EVE Time)
let localDate = new Date();
@@ -1090,7 +1090,7 @@ define([
* @param timestamp
* @returns {Date}
*/
let convertTimestampToServerTime = function(timestamp){
let convertTimestampToServerTime = timestamp => {
let currentTimeZoneOffsetInMinutes = new Date().getTimezoneOffset();
return new Date( (timestamp + (currentTimeZoneOffsetInMinutes * 60)) * 1000);
};
@@ -1101,7 +1101,7 @@ define([
* @param date2
* @returns {{}}
*/
let getTimeDiffParts = function(date1, date2){
let getTimeDiffParts = (date1, date2) => {
let parts = {};
let time1 = date1.getTime();
let time2 = date2.getTime();
@@ -1131,7 +1131,7 @@ define([
* start time measurement by a unique string identifier
* @param timerName
*/
let timeStart = function(timerName){
let timeStart = timerName => {
if(typeof performance === 'object'){
stopTimerCache[timerName] = performance.now();
@@ -1145,7 +1145,7 @@ define([
* @param timerName
* @returns {number}
*/
let timeStop = function(timerName){
let timeStop = timerName => {
let duration = 0;
@@ -1175,7 +1175,7 @@ define([
* @param charCounterElement
* @param maxCharLength
*/
let updateCounter = function(field, charCounterElement, maxCharLength){
let updateCounter = (field, charCounterElement, maxCharLength) => {
let value = field.val();
let inputLength = value.length;
@@ -1201,7 +1201,7 @@ define([
* @param logKey
* @param options
*/
let log = function(logKey, options){
let log = (logKey, options) => {
$(window).trigger('pf:log', [logKey, options]);
};
@@ -1210,8 +1210,8 @@ define([
* @param customConfig
* @param desktop
*/
let showNotify = function(customConfig, desktop){
requirejs(['notification'], function(Notification) {
let showNotify = (customConfig, desktop) => {
requirejs(['notification'], Notification => {
Notification.showNotify(customConfig, desktop);
});
};
@@ -1231,7 +1231,7 @@ define([
* @param option
* @returns {string}
*/
let getLogInfo = function(logType, option){
let getLogInfo = (logType, option) => {
let logInfo = '';
if(Init.classes.logTypes.hasOwnProperty(logType)){

View File

@@ -1,176 +1,164 @@
// Buttons
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.buttons', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.buttons', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
}
}(typeof window !== "undefined" ? window : this, function($, PNotify){
PNotify.prototype.options.buttons = {
// Provide a button for the user to manually close the notice.
closer: true,
// Only show the closer button on hover.
closer_hover: true,
// Provide a button for the user to manually stick the notice.
sticker: true,
// Only show the sticker button on hover.
sticker_hover: true,
// Show the buttons even when the nonblock module is in use.
show_on_nonblock: false,
// The various displayed text, helps facilitating internationalization.
labels: {
close: "Close",
stick: "Stick",
unstick: "Unstick"
},
// The classes to use for button icons. Leave them null to use the classes from the styling you're using.
classes: {
closer: null,
pin_up: null,
pin_down: null
}
}(this, function($, PNotify){
PNotify.prototype.options.buttons = {
// Provide a button for the user to manually close the notice.
closer: true,
// Only show the closer button on hover.
closer_hover: true,
// Provide a button for the user to manually stick the notice.
sticker: true,
// Only show the sticker button on hover.
sticker_hover: true,
// Show the buttons even when the nonblock module is in use.
show_on_nonblock: false,
// The various displayed text, helps facilitating internationalization.
labels: {
close: "Close",
stick: "Stick",
unstick: "Unstick"
};
PNotify.prototype.modules.buttons = {
init: function(notice, options){
var that = this;
notice.elem.on({
"mouseenter": function(e){
// Show the buttons.
if (that.options.sticker && (!(notice.options.nonblock && notice.options.nonblock.nonblock) || that.options.show_on_nonblock)) {
that.sticker.trigger("pnotify:buttons:toggleStick").css("visibility", "visible");
}
if (that.options.closer && (!(notice.options.nonblock && notice.options.nonblock.nonblock) || that.options.show_on_nonblock)) {
that.closer.css("visibility", "visible");
}
},
// The classes to use for button icons. Leave them null to use the classes from the styling you're using.
classes: {
closer: null,
pin_up: null,
pin_down: null
"mouseleave": function(e){
// Hide the buttons.
if (that.options.sticker_hover) {
that.sticker.css("visibility", "hidden");
}
if (that.options.closer_hover) {
that.closer.css("visibility", "hidden");
}
}
};
PNotify.prototype.modules.buttons = {
closer: null,
sticker: null,
});
init: function(notice, options){
var that = this;
notice.elem.on({
"mouseenter": function(e){
// Show the buttons.
if (that.options.sticker && (!(notice.options.nonblock && notice.options.nonblock.nonblock) || that.options.show_on_nonblock)) {
that.sticker.trigger("pnotify:buttons:toggleStick").css("visibility", "visible");
}
if (that.options.closer && (!(notice.options.nonblock && notice.options.nonblock.nonblock) || that.options.show_on_nonblock)) {
that.closer.css("visibility", "visible");
}
},
"mouseleave": function(e){
// Hide the buttons.
if (that.options.sticker_hover) {
that.sticker.css("visibility", "hidden");
}
if (that.options.closer_hover) {
that.closer.css("visibility", "hidden");
}
}
});
// Provide a button to stick the notice.
this.sticker = $("<div />", {
"class": "ui-pnotify-sticker",
"aria-role": "button",
"aria-pressed": notice.options.hide ? "false" : "true",
"tabindex": "0",
"title": notice.options.hide ? options.labels.stick : options.labels.unstick,
"css": {
"cursor": "pointer",
"visibility": options.sticker_hover ? "hidden" : "visible"
},
"click": function(){
notice.options.hide = !notice.options.hide;
if (notice.options.hide) {
notice.queueRemove();
} else {
notice.cancelRemove();
}
$(this).trigger("pnotify:buttons:toggleStick");
}
})
.bind("pnotify:buttons:toggleStick", function(){
var pin_up = that.options.classes.pin_up === null ? notice.styles.pin_up : that.options.classes.pin_up;
var pin_down = that.options.classes.pin_down === null ? notice.styles.pin_down : that.options.classes.pin_down;
$(this)
.attr("title", notice.options.hide ? that.options.labels.stick : that.options.labels.unstick)
.children()
.attr("class", "")
.addClass(notice.options.hide ? pin_up : pin_down)
.attr("aria-pressed", notice.options.hide ? "false" : "true");
})
.append("<span />")
.trigger("pnotify:buttons:toggleStick")
.prependTo(notice.container);
if (!options.sticker || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.sticker.css("display", "none");
}
// Provide a button to close the notice.
this.closer = $("<div />", {
"class": "ui-pnotify-closer",
"aria-role": "button",
"tabindex": "0",
"title": options.labels.close,
"css": {"cursor": "pointer", "visibility": options.closer_hover ? "hidden" : "visible"},
"click": function(){
notice.remove(false);
that.sticker.css("visibility", "hidden");
that.closer.css("visibility", "hidden");
}
})
.append($("<span />", {"class": options.classes.closer === null ? notice.styles.closer : options.classes.closer}))
.prependTo(notice.container);
if (!options.closer || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.closer.css("display", "none");
}
// Provide a button to stick the notice.
this.sticker = $("<div />", {
"class": "ui-pnotify-sticker",
"aria-role": "button",
"aria-pressed": notice.options.hide ? "false" : "true",
"tabindex": "0",
"title": notice.options.hide ? options.labels.stick : options.labels.unstick,
"css": {
"cursor": "pointer",
"visibility": options.sticker_hover ? "hidden" : "visible"
},
update: function(notice, options){
// Update the sticker and closer buttons.
if (!options.closer || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.closer.css("display", "none");
} else if (options.closer) {
this.closer.css("display", "block");
}
if (!options.sticker || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.sticker.css("display", "none");
} else if (options.sticker) {
this.sticker.css("display", "block");
}
// Update the sticker icon.
this.sticker.trigger("pnotify:buttons:toggleStick");
// Update the close icon.
this.closer.find("span").attr("class", "").addClass(options.classes.closer === null ? notice.styles.closer : options.classes.closer);
// Update the hover status of the buttons.
if (options.sticker_hover) {
this.sticker.css("visibility", "hidden");
} else if (!(notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.sticker.css("visibility", "visible");
}
if (options.closer_hover) {
this.closer.css("visibility", "hidden");
} else if (!(notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.closer.css("visibility", "visible");
}
"click": function(){
notice.options.hide = !notice.options.hide;
if (notice.options.hide) {
notice.queueRemove();
} else {
notice.cancelRemove();
}
$(this).trigger("pnotify:buttons:toggleStick");
}
};
$.extend(PNotify.styling.brighttheme, {
closer: "brighttheme-icon-closer",
pin_up: "brighttheme-icon-sticker",
pin_down: "brighttheme-icon-sticker brighttheme-icon-stuck"
});
$.extend(PNotify.styling.jqueryui, {
closer: "ui-icon ui-icon-close",
pin_up: "ui-icon ui-icon-pin-w",
pin_down: "ui-icon ui-icon-pin-s"
});
$.extend(PNotify.styling.bootstrap2, {
closer: "icon-remove",
pin_up: "icon-pause",
pin_down: "icon-play"
});
$.extend(PNotify.styling.bootstrap3, {
closer: "glyphicon glyphicon-remove",
pin_up: "glyphicon glyphicon-pause",
pin_down: "glyphicon glyphicon-play"
});
$.extend(PNotify.styling.fontawesome, {
closer: "fas fa-times",
pin_up: "fas fa-pause",
pin_down: "fas fa-play"
});
})
.bind("pnotify:buttons:toggleStick", function(){
var pin_up = that.options.classes.pin_up === null ? notice.styles.pin_up : that.options.classes.pin_up;
var pin_down = that.options.classes.pin_down === null ? notice.styles.pin_down : that.options.classes.pin_down;
$(this)
.attr("title", notice.options.hide ? that.options.labels.stick : that.options.labels.unstick)
.children()
.attr("class", "")
.addClass(notice.options.hide ? pin_up : pin_down)
.attr("aria-pressed", notice.options.hide ? "false" : "true");
})
.append("<span />")
.trigger("pnotify:buttons:toggleStick")
.prependTo(notice.container);
if (!options.sticker || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.sticker.css("display", "none");
}
// Provide a button to close the notice.
this.closer = $("<div />", {
"class": "ui-pnotify-closer",
"aria-role": "button",
"tabindex": "0",
"title": options.labels.close,
"css": {"cursor": "pointer", "visibility": options.closer_hover ? "hidden" : "visible"},
"click": function(){
notice.remove(false);
that.sticker.css("visibility", "hidden");
that.closer.css("visibility", "hidden");
}
})
.append($("<span />", {"class": options.classes.closer === null ? notice.styles.closer : options.classes.closer}))
.prependTo(notice.container);
if (!options.closer || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.closer.css("display", "none");
}
},
update: function(notice, options){
// Update the sticker and closer buttons.
if (!options.closer || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.closer.css("display", "none");
} else if (options.closer) {
this.closer.css("display", "block");
}
if (!options.sticker || (notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.sticker.css("display", "none");
} else if (options.sticker) {
this.sticker.css("display", "block");
}
// Update the sticker icon.
this.sticker.trigger("pnotify:buttons:toggleStick");
// Update the close icon.
this.closer.find("span").attr("class", "").addClass(options.classes.closer === null ? notice.styles.closer : options.classes.closer);
// Update the hover status of the buttons.
if (options.sticker_hover) {
this.sticker.css("visibility", "hidden");
} else if (!(notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.sticker.css("visibility", "visible");
}
if (options.closer_hover) {
this.closer.css("visibility", "hidden");
} else if (!(notice.options.nonblock && notice.options.nonblock.nonblock && !options.show_on_nonblock)) {
this.closer.css("visibility", "visible");
}
}
};
$.extend(PNotify.styling.brighttheme, {
closer: "brighttheme-icon-closer",
pin_up: "brighttheme-icon-sticker",
pin_down: "brighttheme-icon-sticker brighttheme-icon-stuck"
});
$.extend(PNotify.styling.bootstrap3, {
closer: "glyphicon glyphicon-remove",
pin_up: "glyphicon glyphicon-pause",
pin_down: "glyphicon glyphicon-play"
});
$.extend(PNotify.styling.fontawesome, {
closer: "fa fa-times",
pin_up: "fa fa-pause",
pin_down: "fa fa-play"
});
return PNotify;
}));

View File

@@ -1,50 +1,51 @@
// Callbacks
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.callbacks', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
}
}(this, function($, PNotify){
var _init = PNotify.prototype.init,
_open = PNotify.prototype.open,
_remove = PNotify.prototype.remove;
PNotify.prototype.init = function(){
if (this.options.before_init) {
this.options.before_init(this.options);
}
_init.apply(this, arguments);
if (this.options.after_init) {
this.options.after_init(this);
}
};
PNotify.prototype.open = function(){
var ret;
if (this.options.before_open) {
ret = this.options.before_open(this);
}
if (ret !== false) {
_open.apply(this, arguments);
if (this.options.after_open) {
this.options.after_open(this);
}
}
};
PNotify.prototype.remove = function(timer_hide){
var ret;
if (this.options.before_close) {
ret = this.options.before_close(this, timer_hide);
}
if (ret !== false) {
_remove.apply(this, arguments);
if (this.options.after_close) {
this.options.after_close(this, timer_hide);
}
}
};
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.callbacks', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
}
}(typeof window !== "undefined" ? window : this, function($, PNotify){
var _init = PNotify.prototype.init,
_open = PNotify.prototype.open,
_remove = PNotify.prototype.remove;
PNotify.prototype.init = function(){
if (this.options.before_init) {
this.options.before_init(this.options);
}
_init.apply(this, arguments);
if (this.options.after_init) {
this.options.after_init(this);
}
};
PNotify.prototype.open = function(){
var ret;
if (this.options.before_open) {
ret = this.options.before_open(this);
}
if (ret !== false) {
_open.apply(this, arguments);
if (this.options.after_open) {
this.options.after_open(this);
}
}
};
PNotify.prototype.remove = function(timer_hide){
var ret;
if (this.options.before_close) {
ret = this.options.before_close(this, timer_hide);
}
if (ret !== false) {
_remove.apply(this, arguments);
if (this.options.after_close) {
this.options.after_close(this, timer_hide);
}
}
};
return PNotify;
}));

View File

@@ -1,154 +1,157 @@
// Desktop
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.desktop', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
}
}(this, function($, PNotify){
var permission;
var notify = function(title, options){
// Memoize based on feature detection.
if ("Notification" in window) {
notify = function (title, options) {
return new Notification(title, options);
};
} else if ("mozNotification" in navigator) {
notify = function (title, options) {
// Gecko < 22
return navigator.mozNotification
.createNotification(title, options.body, options.icon)
.show();
};
} else if ("webkitNotifications" in window) {
notify = function (title, options) {
return window.webkitNotifications.createNotification(
options.icon,
title,
options.body
);
};
} else {
notify = function (title, options) {
return null;
};
}
return notify(title, options);
};
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.desktop', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
}
}(typeof window !== "undefined" ? window : this, function($, PNotify){
var permission;
var notify = function(title, options){
// Memoize based on feature detection.
if ("Notification" in window) {
notify = function (title, options) {
return new Notification(title, options);
};
} else if ("mozNotification" in navigator) {
notify = function (title, options) {
// Gecko < 22
return navigator.mozNotification
.createNotification(title, options.body, options.icon)
.show();
};
} else if ("webkitNotifications" in window) {
notify = function (title, options) {
return window.webkitNotifications.createNotification(
options.icon,
title,
options.body
);
};
} else {
notify = function (title, options) {
return null;
};
}
return notify(title, options);
};
PNotify.prototype.options.desktop = {
// Display the notification as a desktop notification.
desktop: false,
// If desktop notifications are not supported or allowed, fall back to a regular notice.
fallback: true,
// The URL of the icon to display. If false, no icon will show. If null, a default icon will show.
icon: null,
// Using a tag lets you update an existing notice, or keep from duplicating notices between tabs.
// If you leave tag null, one will be generated, facilitating the "update" function.
// see: http://www.w3.org/TR/notifications/#tags-example
tag: null
};
PNotify.prototype.modules.desktop = {
tag: null,
icon: null,
genNotice: function(notice, options){
if (options.icon === null) {
this.icon = "http://sciactive.com/pnotify/includes/desktop/"+notice.options.type+".png";
} else if (options.icon === false) {
this.icon = null;
} else {
this.icon = options.icon;
}
if (this.tag === null || options.tag !== null) {
this.tag = options.tag === null ? "PNotify-"+Math.round(Math.random() * 1000000) : options.tag;
}
notice.desktop = notify(notice.options.title, {
icon: this.icon,
body: options.text || notice.options.text,
tag: this.tag
});
if (!("close" in notice.desktop) && ("cancel" in notice.desktop)) {
notice.desktop.close = function(){
notice.desktop.cancel();
};
}
notice.desktop.onclick = function(){
notice.elem.trigger("click");
};
notice.desktop.onclose = function(){
if (notice.state !== "closing" && notice.state !== "closed") {
notice.remove();
}
};
},
init: function(notice, options){
if (!options.desktop)
return;
permission = PNotify.desktop.checkPermission();
if (permission !== 0) {
// Keep the notice from opening if fallback is false.
if (!options.fallback) {
notice.options.auto_display = false;
}
return;
}
this.genNotice(notice, options);
},
update: function(notice, options, oldOpts){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
this.genNotice(notice, options);
},
beforeOpen: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
},
afterOpen: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
if ("show" in notice.desktop) {
notice.desktop.show();
}
},
beforeClose: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
},
afterClose: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
if ("close" in notice.desktop) {
notice.desktop.close();
}
}
};
PNotify.desktop = {
permission: function(){
if (typeof Notification !== "undefined" && "requestPermission" in Notification) {
Notification.requestPermission();
} else if ("webkitNotifications" in window) {
window.webkitNotifications.requestPermission();
}
},
checkPermission: function(){
if (typeof Notification !== "undefined" && "permission" in Notification) {
return (Notification.permission === "granted" ? 0 : 1);
} else if ("webkitNotifications" in window) {
return window.webkitNotifications.checkPermission() == 0 ? 0 : 1;
} else {
return 1;
}
}
};
permission = PNotify.desktop.checkPermission();
PNotify.prototype.options.desktop = {
// Display the notification as a desktop notification.
desktop: false,
// If desktop notifications are not supported or allowed, fall back to a regular notice.
fallback: true,
// The URL of the icon to display. If false, no icon will show. If null, a default icon will show.
icon: null,
// Using a tag lets you update an existing notice, or keep from duplicating notices between tabs.
// If you leave tag null, one will be generated, facilitating the "update" function.
// see: http://www.w3.org/TR/notifications/#tags-example
tag: null,
// Optionally display a different title for the desktop.
title: null,
// Optionally display different text for the desktop.
text: null
};
PNotify.prototype.modules.desktop = {
genNotice: function(notice, options){
if (options.icon === null) {
this.icon = "http://sciactive.com/pnotify/includes/desktop/"+notice.options.type+".png";
} else if (options.icon === false) {
this.icon = null;
} else {
this.icon = options.icon;
}
if (this.tag === null || options.tag !== null) {
this.tag = options.tag === null ? "PNotify-"+Math.round(Math.random() * 1000000) : options.tag;
}
notice.desktop = notify(options.title || notice.options.title, {
icon: this.icon,
body: options.text || notice.options.text,
tag: this.tag
});
if (!("close" in notice.desktop) && ("cancel" in notice.desktop)) {
notice.desktop.close = function(){
notice.desktop.cancel();
};
}
notice.desktop.onclick = function(){
notice.elem.trigger("click");
};
notice.desktop.onclose = function(){
if (notice.state !== "closing" && notice.state !== "closed") {
notice.remove();
}
};
},
init: function(notice, options){
if (!options.desktop)
return;
permission = PNotify.desktop.checkPermission();
if (permission !== 0) {
// Keep the notice from opening if fallback is false.
if (!options.fallback) {
notice.options.auto_display = false;
}
return;
}
this.genNotice(notice, options);
},
update: function(notice, options, oldOpts){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
this.genNotice(notice, options);
},
beforeOpen: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
},
afterOpen: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
if ("show" in notice.desktop) {
notice.desktop.show();
}
},
beforeClose: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
},
afterClose: function(notice, options){
if ((permission !== 0 && options.fallback) || !options.desktop)
return;
notice.elem.css({'left': '-10000px'}).removeClass('ui-pnotify-in');
if ("close" in notice.desktop) {
notice.desktop.close();
}
}
};
PNotify.desktop = {
permission: function(){
if (typeof Notification !== "undefined" && "requestPermission" in Notification) {
Notification.requestPermission();
} else if ("webkitNotifications" in window) {
window.webkitNotifications.requestPermission();
}
},
checkPermission: function(){
if (typeof Notification !== "undefined" && "permission" in Notification) {
return (Notification.permission === "granted" ? 0 : 1);
} else if ("webkitNotifications" in window) {
return window.webkitNotifications.checkPermission() == 0 ? 0 : 1;
} else {
return 1;
}
}
};
permission = PNotify.desktop.checkPermission();
return PNotify;
}));

File diff suppressed because it is too large Load Diff

View File

@@ -1,156 +1,157 @@
// Nonblock
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.nonblock', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
}
}(this, function($, PNotify){
// Some useful regexes.
var re_on = /^on/,
re_mouse_events = /^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/,
re_ui_events = /^(focus|blur|select|change|reset)$|^key(press|down|up)$/,
re_html_events = /^(scroll|resize|(un)?load|abort|error)$/;
// Fire a DOM event.
var dom_event = function(e, orig_e){
var event_object;
e = e.toLowerCase();
if (document.createEvent && this.dispatchEvent) {
// FireFox, Opera, Safari, Chrome
e = e.replace(re_on, '');
if (e.match(re_mouse_events)) {
// This allows the click event to fire on the notice. There is
// probably a much better way to do it.
$(this).offset();
event_object = document.createEvent("MouseEvents");
event_object.initMouseEvent(
e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail,
orig_e.screenX, orig_e.screenY, orig_e.clientX, orig_e.clientY,
orig_e.ctrlKey, orig_e.altKey, orig_e.shiftKey, orig_e.metaKey, orig_e.button, orig_e.relatedTarget
);
} else if (e.match(re_ui_events)) {
event_object = document.createEvent("UIEvents");
event_object.initUIEvent(e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail);
} else if (e.match(re_html_events)) {
event_object = document.createEvent("HTMLEvents");
event_object.initEvent(e, orig_e.bubbles, orig_e.cancelable);
}
if (!event_object) return;
this.dispatchEvent(event_object);
} else {
// Internet Explorer
if (!e.match(re_on)) e = "on"+e;
event_object = document.createEventObject(orig_e);
this.fireEvent(e, event_object);
}
};
if (typeof define === 'function' && define.amd) {
// AMD. Register as a module.
define('pnotify.nonblock', ['jquery', 'pnotify'], factory);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
// CommonJS
module.exports = factory(require('jquery'), require('./pnotify'));
} else {
// Browser globals
factory(root.jQuery, root.PNotify);
}
}(typeof window !== "undefined" ? window : this, function($, PNotify){
// Some useful regexes.
var re_on = /^on/,
re_mouse_events = /^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/,
re_ui_events = /^(focus|blur|select|change|reset)$|^key(press|down|up)$/,
re_html_events = /^(scroll|resize|(un)?load|abort|error)$/;
// Fire a DOM event.
var dom_event = function(e, orig_e){
var event_object;
e = e.toLowerCase();
if (document.createEvent && this.dispatchEvent) {
// FireFox, Opera, Safari, Chrome
e = e.replace(re_on, '');
if (e.match(re_mouse_events)) {
// This allows the click event to fire on the notice. There is
// probably a much better way to do it.
$(this).offset();
event_object = document.createEvent("MouseEvents");
event_object.initMouseEvent(
e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail,
orig_e.screenX, orig_e.screenY, orig_e.clientX, orig_e.clientY,
orig_e.ctrlKey, orig_e.altKey, orig_e.shiftKey, orig_e.metaKey, orig_e.button, orig_e.relatedTarget
);
} else if (e.match(re_ui_events)) {
event_object = document.createEvent("UIEvents");
event_object.initUIEvent(e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail);
} else if (e.match(re_html_events)) {
event_object = document.createEvent("HTMLEvents");
event_object.initEvent(e, orig_e.bubbles, orig_e.cancelable);
}
if (!event_object) return;
this.dispatchEvent(event_object);
} else {
// Internet Explorer
if (!e.match(re_on)) e = "on"+e;
event_object = document.createEventObject(orig_e);
this.fireEvent(e, event_object);
}
};
// This keeps track of the last element the mouse was over, so
// mouseleave, mouseenter, etc can be called.
var nonblock_last_elem;
// This is used to pass events through the notice if it is non-blocking.
var nonblock_pass = function(notice, e, e_name){
notice.elem.addClass("ui-pnotify-nonblock-hide");
var element_below = document.elementFromPoint(e.clientX, e.clientY);
notice.elem.removeClass("ui-pnotify-nonblock-hide");
var jelement_below = $(element_below);
var cursor_style = jelement_below.css("cursor");
if (cursor_style === "auto" && element_below.tagName === "A") {
cursor_style = "pointer";
}
notice.elem.css("cursor", cursor_style !== "auto" ? cursor_style : "default");
// If the element changed, call mouseenter, mouseleave, etc.
if (!nonblock_last_elem || nonblock_last_elem.get(0) != element_below) {
if (nonblock_last_elem) {
dom_event.call(nonblock_last_elem.get(0), "mouseleave", e.originalEvent);
dom_event.call(nonblock_last_elem.get(0), "mouseout", e.originalEvent);
}
dom_event.call(element_below, "mouseenter", e.originalEvent);
dom_event.call(element_below, "mouseover", e.originalEvent);
}
dom_event.call(element_below, e_name, e.originalEvent);
// Remember the latest element the mouse was over.
nonblock_last_elem = jelement_below;
};
// This keeps track of the last element the mouse was over, so
// mouseleave, mouseenter, etc can be called.
var nonblock_last_elem;
// This is used to pass events through the notice if it is non-blocking.
var nonblock_pass = function(notice, e, e_name){
notice.elem.addClass("ui-pnotify-nonblock-hide");
var element_below = document.elementFromPoint(e.clientX, e.clientY);
notice.elem.removeClass("ui-pnotify-nonblock-hide");
var jelement_below = $(element_below);
var cursor_style = jelement_below.css("cursor");
if (cursor_style === "auto" && element_below.tagName === "A") {
cursor_style = "pointer";
}
notice.elem.css("cursor", cursor_style !== "auto" ? cursor_style : "default");
// If the element changed, call mouseenter, mouseleave, etc.
if (!nonblock_last_elem || nonblock_last_elem.get(0) != element_below) {
if (nonblock_last_elem) {
dom_event.call(nonblock_last_elem.get(0), "mouseleave", e.originalEvent);
dom_event.call(nonblock_last_elem.get(0), "mouseout", e.originalEvent);
}
dom_event.call(element_below, "mouseenter", e.originalEvent);
dom_event.call(element_below, "mouseover", e.originalEvent);
}
dom_event.call(element_below, e_name, e.originalEvent);
// Remember the latest element the mouse was over.
nonblock_last_elem = jelement_below;
};
PNotify.prototype.options.nonblock = {
// Create a non-blocking notice. It lets the user click elements underneath it.
nonblock: false
};
PNotify.prototype.modules.nonblock = {
init: function(notice, options){
var that = this;
notice.elem.on({
"mouseenter": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
if (that.options.nonblock) {
// If it's non-blocking, animate to the other opacity.
notice.elem.addClass("ui-pnotify-nonblock-fade");
}
},
"mouseleave": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
nonblock_last_elem = null;
notice.elem.css("cursor", "auto");
// Animate back to the normal opacity.
if (that.options.nonblock && notice.animating !== "out") {
notice.elem.removeClass("ui-pnotify-nonblock-fade");
}
},
"mouseover": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
},
"mouseout": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
},
"mousemove": function(e){
if (that.options.nonblock) {
e.stopPropagation();
nonblock_pass(notice, e, "onmousemove");
}
},
"mousedown": function(e){
if (that.options.nonblock) {
e.stopPropagation();
e.preventDefault();
nonblock_pass(notice, e, "onmousedown");
}
},
"mouseup": function(e){
if (that.options.nonblock) {
e.stopPropagation();
e.preventDefault();
nonblock_pass(notice, e, "onmouseup");
}
},
"click": function(e){
if (that.options.nonblock) {
e.stopPropagation();
nonblock_pass(notice, e, "onclick");
}
},
"dblclick": function(e){
if (that.options.nonblock) {
e.stopPropagation();
nonblock_pass(notice, e, "ondblclick");
}
}
});
}
};
PNotify.prototype.options.nonblock = {
// Create a non-blocking notice. It lets the user click elements underneath it.
nonblock: false
};
PNotify.prototype.modules.nonblock = {
init: function(notice, options){
var that = this;
notice.elem.on({
"mouseenter": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
if (that.options.nonblock) {
// If it's non-blocking, animate to the other opacity.
notice.elem.addClass("ui-pnotify-nonblock-fade");
}
},
"mouseleave": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
nonblock_last_elem = null;
notice.elem.css("cursor", "auto");
// Animate back to the normal opacity.
if (that.options.nonblock && notice.animating !== "out") {
notice.elem.removeClass("ui-pnotify-nonblock-fade");
}
},
"mouseover": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
},
"mouseout": function(e){
if (that.options.nonblock) {
e.stopPropagation();
}
},
"mousemove": function(e){
if (that.options.nonblock) {
e.stopPropagation();
nonblock_pass(notice, e, "onmousemove");
}
},
"mousedown": function(e){
if (that.options.nonblock) {
e.stopPropagation();
e.preventDefault();
nonblock_pass(notice, e, "onmousedown");
}
},
"mouseup": function(e){
if (that.options.nonblock) {
e.stopPropagation();
e.preventDefault();
nonblock_pass(notice, e, "onmouseup");
}
},
"click": function(e){
if (that.options.nonblock) {
e.stopPropagation();
nonblock_pass(notice, e, "onclick");
}
},
"dblclick": function(e){
if (that.options.nonblock) {
e.stopPropagation();
nonblock_pass(notice, e, "ondblclick");
}
}
});
}
};
return PNotify;
}));

View File

@@ -1,6 +1,6 @@
/*
/*!
Author : Hunter Perrin
Version : 3.0.0
Version : 3.2.0
Link : http://sciactive.com/pnotify/
*/
/* -- Notice */
@@ -37,25 +37,25 @@ body > .ui-pnotify-modal-overlay {
transition: left .5s ease, top .5s ease, right .5s ease, bottom .5s ease;
}
.ui-pnotify.ui-pnotify-fade-slow {
transition: opacity .6s linear;
opacity: 0;
}
.ui-pnotify.ui-pnotify-fade-slow.ui-pnotify.ui-pnotify-move {
transition: opacity .6s linear, left .5s ease, top .5s ease, right .5s ease, bottom .5s ease;
}
.ui-pnotify.ui-pnotify-fade-normal {
transition: opacity .4s linear;
opacity: 0;
}
.ui-pnotify.ui-pnotify-fade-normal.ui-pnotify.ui-pnotify-move {
.ui-pnotify.ui-pnotify-fade-slow.ui-pnotify.ui-pnotify-move {
transition: opacity .4s linear, left .5s ease, top .5s ease, right .5s ease, bottom .5s ease;
}
.ui-pnotify.ui-pnotify-fade-normal {
transition: opacity .25s linear;
opacity: 0;
}
.ui-pnotify.ui-pnotify-fade-normal.ui-pnotify.ui-pnotify-move {
transition: opacity .25s linear, left .5s ease, top .5s ease, right .5s ease, bottom .5s ease;
}
.ui-pnotify.ui-pnotify-fade-fast {
transition: opacity .2s linear;
transition: opacity .1s linear;
opacity: 0;
}
.ui-pnotify.ui-pnotify-fade-fast.ui-pnotify.ui-pnotify-move {
transition: opacity .2s linear, left .5s ease, top .5s ease, right .5s ease, bottom .5s ease;
transition: opacity .1s linear, left .5s ease, top .5s ease, right .5s ease, bottom .5s ease;
}
.ui-pnotify.ui-pnotify-fade-in {
opacity: 1;

View File

@@ -31,7 +31,7 @@
@import "library/data-tables/_all"; // DataTables 1.10.12 + extensions
@import "library/x-editable/_bootstrap-editable"; // X-editable - v1.5.1
@import "library/pnotify/_pnotify"; // PNotify styles - v3.0.0
@import "library/pnotify/_pnotify"; // PNotify styles - v3.2.0
@import "library/pnotify/_pnotify.nonblock";
@import "library/pnotify/_pnotify.custom"; // PNotify custom styles
@import "library/slidebars/_slidebars"; // Slidebars Navigation