From 70c0a8c2e020f30e1b9f5cd8de18e01c80e0a1c6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 9 Feb 2017 23:19:26 +0300 Subject: [PATCH] pass several image files used in notify messages to frontend as base64 to prevent broken error messages in case network connection is down. also, update some close buttons to show correct cursor. --- css/tt-rss.css | 5 +++-- css/utility.css | 1 + include/functions2.php | 15 +++++++++++++++ js/functions.js | 8 ++++---- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/css/tt-rss.css b/css/tt-rss.css index ccfedd60..6476d705 100644 --- a/css/tt-rss.css +++ b/css/tt-rss.css @@ -180,8 +180,8 @@ a:hover { width : 100%; } -#notify span.close { - text-align : right; +#notify img.close { + cursor : pointer; } #notify span { @@ -312,6 +312,7 @@ div.filterTestHolder { top: -2px; right: -21px; line-height: 20px; + cursor : pointer; } .alert-success { diff --git a/css/utility.css b/css/utility.css index 37d96e0c..01aff091 100644 --- a/css/utility.css +++ b/css/utility.css @@ -85,6 +85,7 @@ a:hover { top: -2px; right: -21px; line-height: 20px; + cursor : pointer; } .alert-success { diff --git a/include/functions2.php b/include/functions2.php index 6674c773..56676b16 100644 --- a/include/functions2.php +++ b/include/functions2.php @@ -44,6 +44,11 @@ $params['simple_update'] = defined('SIMPLE_UPDATE_MODE') && SIMPLE_UPDATE_MODE; + $params["icon_alert"] = base64_img("images/alert.png"); + $params["icon_information"] = base64_img("images/information.png"); + $params["icon_cross"] = base64_img("images/cross.png"); + $params["icon_indicator_white"] = base64_img("images/indicator_white.gif"); + return $params; } @@ -2485,4 +2490,14 @@ return $errors[$code]; } + + function base64_img($filename) { + if (file_exists($filename)) { + $ext = pathinfo($filename, PATHINFO_EXTENSION); + + return "data:image/$ext;base64," . base64_encode(file_get_contents($filename)); + } else { + return ""; + } + } ?> diff --git a/js/functions.js b/js/functions.js index 6ba0922a..e29a834c 100755 --- a/js/functions.js +++ b/js/functions.js @@ -212,15 +212,15 @@ function notify_real(msg, no_hide, n_type) { msg = " " + __(msg) + ""; if (n_type == 2) { - msg = "" + msg; + msg = "" + msg; no_hide = true; } else if (n_type == 3) { - msg = "" + msg; + msg = "" + msg; } else if (n_type == 4) { - msg = "" + msg; + msg = "" + msg; } - msg += " "; n.innerHTML = msg; -- 2.39.5