]> git.wh0rd.org Git - tt-rss.git/commitdiff
pass several image files used in notify messages to frontend as base64 to prevent...
authorAndrew Dolgov <noreply@fakecake.org>
Thu, 9 Feb 2017 20:19:26 +0000 (23:19 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Thu, 9 Feb 2017 20:19:26 +0000 (23:19 +0300)
css/tt-rss.css
css/utility.css
include/functions2.php
js/functions.js

index ccfedd6077785e06bab5314b2013e8315698e938..6476d705e86ba1af6deedbe6ac6dfeca3a085421 100644 (file)
@@ -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 {
index 37d96e0c1329f5d69fbad87f7c9b9117717542a2..01aff091f16270ef9fb51ca7f08540264dd82f64 100644 (file)
@@ -85,6 +85,7 @@ a:hover {
        top: -2px;
        right: -21px;
        line-height: 20px;
+       cursor :  pointer;
 }
 
 .alert-success {
index 6674c77346d9e1c0125a423104d921d3e0f48284..56676b1655cb56f461a6cdbe39c1a779cecbf844 100644 (file)
 
                $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;
        }
 
 
                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 "";
+               }
+       }
 ?>
index 6ba0922aaacfc930eb5d21408fb869e104cd0154..e29a834c93a5369d84ce50d88fe237bd2f781953 100755 (executable)
@@ -212,15 +212,15 @@ function notify_real(msg, no_hide, n_type) {
        msg = "<span class=\"msg\"> " + __(msg) + "</span>";
 
        if (n_type == 2) {
-               msg = "<span><img src='images/indicator_white.gif'></span>" + msg;
+               msg = "<span><img src=\""+getInitParam("icon_indicator_white")+"\"></span>" + msg;
                no_hide = true;
        } else if (n_type == 3) {
-               msg = "<span><img src='images/alert.png'></span>" + msg;
+               msg = "<span><img src=\""+getInitParam("icon_alert")+"\"></span>" + msg;
        } else if (n_type == 4) {
-               msg = "<span><img src='images/information.png'></span>" + msg;
+               msg = "<span><img src=\""+getInitParam("icon_information")+"\"></span>" + msg;
        }
 
-       msg += " <span><img src=\"images/cross.png\" class=\"close\" title=\"" +
+       msg += " <span><img src=\""+getInitParam("icon_cross")+"\" class=\"close\" title=\"" +
                __("Click to close") + "\" onclick=\"notify('')\"></span>";
 
        n.innerHTML = msg;