diff --git a/install/package.json b/install/package.json index 8ab6b07a85..f22b065aa8 100644 --- a/install/package.json +++ b/install/package.json @@ -110,7 +110,7 @@ "nodebb-rewards-essentials": "1.0.0", "nodebb-theme-harmony": "2.0.0-pre.46", "nodebb-theme-lavender": "7.1.17", - "nodebb-theme-peace": "2.2.32", + "nodebb-theme-peace": "2.2.33", "nodebb-theme-persona": "14.0.0-pre.5", "nodebb-widget-essentials": "7.0.31", "nodemailer": "6.9.16", diff --git a/public/scss/generics.scss b/public/scss/generics.scss index 976d71c4d5..db5aaa4675 100644 --- a/public/scss/generics.scss +++ b/public/scss/generics.scss @@ -117,16 +117,21 @@ blockquote { .hover-visible { visibility: hidden; } + .hover-opacity-75 { + opacity: 0; + &:focus { opacity: 0.75 } + } + .hover-opacity-100 { + opacity: 0; + &:focus {opacity: 1; } + } + &:hover { - .hover-d-block { - display: block!important; - } - .hover-d-flex { - display: flex!important; - } - .hover-visible { - visibility: visible; - } + .hover-d-block { display: block!important; } + .hover-d-flex { display: flex!important; } + .hover-visible { visibility: visible; } + .hover-opacity-100 { opacity: 1; } + .hover-opacity-75 { opacity: 0.75; } } } diff --git a/public/vendor/jquery/draggable-background/backgroundDraggable.js b/public/vendor/jquery/draggable-background/backgroundDraggable.js index 8453e5aeb0..6785d32e6a 100644 --- a/public/vendor/jquery/draggable-background/backgroundDraggable.js +++ b/public/vendor/jquery/draggable-background/backgroundDraggable.js @@ -79,6 +79,39 @@ imageDimensions = getBackgroundImageDimensions($el); } + $(window).on('keydown.dbg', (e) => { + var pos = $el.css('background-position').match(/(-?\d+).*?\s(-?\d+)/) || []; + var xPos = parseInt(pos[1]) || 0; + var yPos = parseInt(pos[2]) || 0; + // We must convert percentage back to pixels + if (options.units == 'percent') { + xPos = Math.round(xPos / -200 * imageDimensions.width); + yPos = Math.round(yPos / -200 * imageDimensions.height); + } + + var x = 0, y = 0; + if (e.which === 37) { // left + x = -5 + } else if (e.which === 39) { // right + x = 5 + } else if (e.which === 38) { // up + y = -5 + } else if (e.which === 40) { // down + y = +5 + } + if (options.units === 'percent') { + xPos = options.axis === 'y' ? xPos : limit(-imageDimensions.width/2, 0, xPos+x, options.bound); + yPos = options.axis === 'x' ? yPos : limit(-imageDimensions.height/2, 0, yPos+y, options.bound); + + // Convert pixels to percentage + $el.css('background-position', xPos / imageDimensions.width * -200 + '% ' + yPos / imageDimensions.height * -200 + '%'); + } else { + xPos = options.axis === 'y' ? xPos : limit($el.innerWidth()-imageDimensions.width, 0, xPos+x, options.bound); + yPos = options.axis === 'x' ? yPos : limit($el.innerHeight()-imageDimensions.height, 0, yPos+y, options.bound); + } + return [37, 38, 39, 40].includes(e.which) ? false : undefined; + }); + $el.on('mousedown.dbg touchstart.dbg', function(e) { if (e.target !== $el[0]) { return; @@ -145,7 +178,7 @@ Plugin.prototype.disable = function() { var $el = $(this.element); $el.off('mousedown.dbg touchstart.dbg'); - $window.off('mousemove.dbg touchmove.dbg mouseup.dbg touchend.dbg mouseleave.dbg'); + $window.off('mousemove.dbg touchmove.dbg mouseup.dbg touchend.dbg mouseleave.dbg keydown.dbg'); } $.fn.backgroundDraggable = function(options) { diff --git a/src/controllers/api.js b/src/controllers/api.js index 2d7411e40c..9b85dd2d30 100644 --- a/src/controllers/api.js +++ b/src/controllers/api.js @@ -91,7 +91,7 @@ apiController.loadConfig = async function (req) { }, emailPrompt: meta.config.emailPrompt, useragent: { - isSafari: req.useragent.isSafari, + isSafari: req.useragent && req.useragent.isSafari, }, fontawesome: { pro: fontawesome_pro, diff --git a/src/views/admin/dashboard/searches.tpl b/src/views/admin/dashboard/searches.tpl index 97c02cc863..a5f34852b3 100644 --- a/src/views/admin/dashboard/searches.tpl +++ b/src/views/admin/dashboard/searches.tpl @@ -17,7 +17,7 @@ -
| [[admin/dashboard:search-term]] | [[admin/dashboard:search-count]] | @@ -30,8 +30,8 @@ {{{ end }}} {{{ each searches }}}||
|---|---|---|---|
| {searches.value} | -{formattedNumber(searches.score)} | +{searches.value} | +{formattedNumber(searches.score)} |