- Fixed some minor UI issues

This commit is contained in:
Mark Friedrich
2020-02-01 23:25:13 +01:00
parent 70dbbfc261
commit 4a5636456e
128 changed files with 37 additions and 992 deletions

View File

@@ -13,8 +13,8 @@ NAME = Pathfinder
; Version is used for CSS/JS cache busting and is part of the URL for static resources:
; e.g. public/js/vX.X.X/app.js
; Syntax: String (current version)
; Default: v1.5.6
VERSION = v1.5.6
; Default: v2.0.0
VERSION = v2.0.0
; Contact information [optional]
; Shown on 'licence', 'contact' page.

View File

@@ -94,7 +94,9 @@ let trackTable = {
let uglifyJsOptions = {
warnings: true,
toplevel: false,
ecma: 8
ecma: 8,
nameCache: {}, // cache mangled variable and property names across multiple invocations of minify()
keep_classnames: true // pass true to prevent discarding or mangling of class names.
};
// Sourcemaps options

View File

@@ -349,7 +349,8 @@ define([
// show animation -------------------------------------------------------------------------------------
$(moduleElement).velocity({
opacity: [1, 0],
translateY: [0, +20]
translateY: [0, +20],
translateZ: 0 // Force HA by animating a 3D property
}, {
duration: Init.animationSpeed.mapModule,
easing: 'easeOutSine',

View File

@@ -209,10 +209,11 @@ define([
xkey: xKey,
ykeys: yKeys,
labels: this.getInfoForGraph(graphKey, 'labels'),
xLabelAngle: 0,
parseTime: false,
ymin: 0,
yLabelFormat: value => Math.round(value),
padding: 8,
padding: 10,
hideHover: true,
pointSize: 2.5,
lineColors: this.getInfoForGraph(graphKey, 'lineColors'),
@@ -221,9 +222,10 @@ define([
lineWidth: 1.5,
grid: true,
gridStrokeWidth: 0.3,
gridTextSize: 9,
gridTextFamily: 'Oxygen Bold',
gridTextSize: 10,
gridTextFamily: 'Arial, "Oxygen Bold"',
gridTextColor: '#63676a',
gridTextWeight: 'bold',
behaveLikeLine: false,
goals: goals,
goalStrokeWidth: 1,

View File

@@ -205,7 +205,7 @@ define([
this.showKills(this._config.chunkCountKills);
}else{
// no kills found
this.moduleElement.append(
this._bodyEl.append(
this.newLabelElement('No kills found within the last 24h', ['label-success'])
);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,209 +0,0 @@
define([
'jquery',
'app/init',
'PNotify',
//'pnotify.buttons',
//'pnotify.confirm',
'PNotifyNonBlock',
'PNotifyDesktop',
//'pnotify.history',
'PNotifyCallbacks'
], ($, Init, PNotify) => {
'use strict';
let config = {
title: '',
text: '',
type: '', // 'info', 'success', error, 'warning'
icon: false,
styling: 'fontawesome', // 'fontawesome', 'bootstrap3', 'jqueryui'
animate_speed: 'fast', // animation speed for notifications moving up/down
hide: true, // close after few seconds
delay: 5000, // visible time for notification in browser
mouse_reset: true, // Reset the hide timer if the mouse moves over the notice.
shadow: true,
addclass: 'stack-bottomright', // class for display, must changed on stack different stacks
width: '250px',
// nonblock extension parameter (click through notifications)
nonblock: {
nonblock: true, // change for enable
nonblock_opacity: 0.9
},
// desktop extension "Web Notifications"
desktop: {
desktop: false, // change for enable
icon: Init.path.img + 'notifications/logo.png' // default image for desktop notifications
}
};
// initial page title (cached)
let initialPageTitle = document.title;
// global blink timeout cache
let blinkTimer;
// stack container for all notifications
let stack = {
bottomRight: {
stack: {
dir1: 'up',
dir2: 'left',
firstpos1: 30,
firstpos2: 10,
spacing1: 5,
spacing2: 5,
push: 'bottom'
},
addclass: 'stack-bottomright',
width: '250px',
},
barBottom: {
stack: {
dir1: 'up',
dir2: 'right',
// context: $('body'),
spacing1: 0,
spacing2: 0
},
addclass: 'stack-bar-bottom',
width: '70%',
}
};
/**
* show a notification in browser and/or "Web Notifications" in OS
* @param customConfig
* @param settings
*/
let showNotify = (customConfig, settings) => {
customConfig = $.extend(true, {}, config, customConfig );
// desktop notification
if(
settings &&
settings.desktop === true
){
// ask for Web Notifications permission
PNotify.desktop.permission();
customConfig.delay = 10000;
customConfig.nonblock.nonblock = false; // true results in error on "click" desktop notification
customConfig.desktop.desktop = true;
// make browser tab blink
startTabBlink(customConfig.title);
}
// set notification stack
if(
settings &&
settings.stack
){
customConfig.stack = stack[settings.stack].stack;
customConfig.addclass = stack[settings.stack].addclass;
customConfig.width = stack[settings.stack].width;
}else{
customConfig.stack = stack.bottomRight.stack;
customConfig.addclass = stack.bottomRight.addclass;
}
switch(customConfig.type){
case 'info':
customConfig.icon = 'fas fa-info fa-fw fa-lg';
break;
case 'success':
customConfig.icon = 'fas fa-check fa-fw fa-lg';
break;
case 'warning':
customConfig.icon = 'fas fa-exclamation-triangle fa-fw fa-lg';
break;
case 'error':
customConfig.icon = 'fas fa-times fa-fw fa-lg';
break;
case 'lock':
customConfig.icon = 'fas fa-lock fa-fw fa-lg';
customConfig.type = 'success';
break;
case 'unlock':
customConfig.icon = 'fas fa-unlock fa-fw fa-lg';
customConfig.type = 'info';
break;
default:
customConfig.icon = false;
}
let notify = new PNotify(customConfig);
if(
settings &&
settings.click
){
// set onclick for notification
notify.get().on('click', settings.click);
}
PNotify.defaults.styling = 'bootstrap3';
PNotify.defaults.icons = 'fontawesome5';
PNotify.defaults.delay = 5000;
PNotify.defaults.width = '250px';
PNotify.notice({
text: "I'm a notice."
});
};
/**
* change document.title and make the browsers tab blink
* @param blinkTitle
*/
let startTabBlink = blinkTitle => {
let initBlink = (function(blinkTitle){
// count blinks if tab is currently active
let activeTabBlinkCount = 0;
let blink = function(){
// number of "blinks" should be limited if tab is currently active
if(window.isVisible){
activeTabBlinkCount++;
}
// toggle page title
document.title = (document.title === blinkTitle) ? initialPageTitle : blinkTitle;
if(activeTabBlinkCount > 10){
stopTabBlink();
}
};
return function(){
if(!blinkTimer){
blinkTimer = setInterval(blink, 1000);
}
};
}(blinkTitle));
initBlink();
};
/**
* stop blinking document.title
*/
let stopTabBlink = () => {
if(blinkTimer){
clearInterval(blinkTimer);
document.title = initialPageTitle;
blinkTimer = null;
}
};
return {
showNotify: showNotify,
startTabBlink: startTabBlink,
stopTabBlink: stopTabBlink
};
});

View File

@@ -1,230 +0,0 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* src/PNotifyNonBlock.html generated by Svelte v2.16.1 */
(function (global, factory) {
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? module.exports = factory(require('./PNotify')) : typeof define === "function" && define.amd ? define('PNotifyNonBlock', ["./PNotify"], factory) : global.PNotifyNonBlock = factory(PNotify);
})(this, function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.NonBlock.defaults);
};
var methods = {
initModule: function initModule(options) {
this.set(options);
this.doNonBlockClass();
},
update: function update() {
this.doNonBlockClass();
},
doNonBlockClass: function doNonBlockClass() {
if (this.get().nonblock) {
this.get()._notice.addModuleClass('nonblock');
} else {
this.get()._notice.removeModuleClass('nonblock');
}
}
};
function setup(Component) {
Component.key = 'NonBlock';
Component.defaults = {
// Use NonBlock.js to create a non-blocking notice. It lets the user click elements underneath it.
nonblock: false
};
Component.init = function (notice) {
return new Component({ target: document.body,
data: {
'_notice': notice
} });
};
// Register the module with PNotify.
PNotify.modules.NonBlock = Component;
};
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyNonBlock(options) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyNonBlock.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_stage: _stage,
_mount: _mount,
_differs: _differs
});
assign(PNotifyNonBlock.prototype, methods);
PNotifyNonBlock.prototype._recompute = noop;
setup(PNotifyNonBlock);
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._slots = blankObject();
component._bind = options._bind;
component._staged = {};
component.options = options;
component.root = options.root || component;
component.store = options.store || component.root.store;
if (!options.root) {
component._beforecreate = [];
component._oncreate = [];
component._aftercreate = [];
}
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
try {
handler.__calling = true;
handler.call(this, data);
} finally {
handler.__calling = false;
}
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
flush(this.root);
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
newState = assign(this._staged, newState);
this._staged = {};
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _stage(newState) {
assign(this._staged, newState);
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function flush(component) {
component._lock = true;
callAll(component._beforecreate);
callAll(component._oncreate);
callAll(component._aftercreate);
component._lock = false;
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
return PNotifyNonBlock;
});
//# sourceMappingURL=PNotifyNonBlock.js.map

View File

@@ -1,164 +0,0 @@
// 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);
}
}(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
}
};
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");
}
},
"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");
}
},
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,51 +0,0 @@
// 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);
}
}(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,157 +0,0 @@
// 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);
}
}(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,
// 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;
}));

View File

@@ -1,157 +0,0 @@
// 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);
}
}(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;
};
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

@@ -349,7 +349,8 @@ define([
// show animation -------------------------------------------------------------------------------------
$(moduleElement).velocity({
opacity: [1, 0],
translateY: [0, +20]
translateY: [0, +20],
translateZ: 0 // Force HA by animating a 3D property
}, {
duration: Init.animationSpeed.mapModule,
easing: 'easeOutSine',

View File

@@ -209,10 +209,11 @@ define([
xkey: xKey,
ykeys: yKeys,
labels: this.getInfoForGraph(graphKey, 'labels'),
xLabelAngle: 0,
parseTime: false,
ymin: 0,
yLabelFormat: value => Math.round(value),
padding: 8,
padding: 10,
hideHover: true,
pointSize: 2.5,
lineColors: this.getInfoForGraph(graphKey, 'lineColors'),
@@ -221,9 +222,10 @@ define([
lineWidth: 1.5,
grid: true,
gridStrokeWidth: 0.3,
gridTextSize: 9,
gridTextFamily: 'Oxygen Bold',
gridTextSize: 10,
gridTextFamily: 'Arial, "Oxygen Bold"',
gridTextColor: '#63676a',
gridTextWeight: 'bold',
behaveLikeLine: false,
goals: goals,
goalStrokeWidth: 1,

View File

@@ -205,7 +205,7 @@ define([
this.showKills(this._config.chunkCountKills);
}else{
// no kills found
this.moduleElement.append(
this._bodyEl.append(
this.newLabelElement('No kills found within the last 24h', ['label-success'])
);
}

Some files were not shown because too many files have changed in this diff Show More