]> git.mxchange.org Git - friendica.git/commitdiff
make errormessages modular and better
authorJakobus Schürz <jakobus.schuerz@schuerz.at>
Sat, 11 Mar 2023 18:23:48 +0000 (19:23 +0100)
committerJakobus Schürz <jakobus.schuerz@schuerz.at>
Tue, 14 Mar 2023 16:32:11 +0000 (17:32 +0100)
src/App/Page.php
view/theme/frio/js/theme.js
view/theme/frio/templates/js_strings.tpl

index c2a77b32513465d3d7a56d8d61d092dfcad842d9..965c04915cccead20ef31d04c9f149b355378b2e 100644 (file)
@@ -253,12 +253,11 @@ class Page implements ArrayAccess
                        '$touch_icon'      => $touch_icon,
                        '$block_public'    => intval($config->get('system', 'block_public')),
                        '$stylesheets'     => $this->stylesheets,
-                        '$likeNetError'    => $l10n->t('Like not successfull (Network error)'),
-                        '$dislikeNetError' => $l10n->t('Dislike not successfull (Network error)'),
-                        '$annonNetError'   => $l10n->t('Sharing not successfull (Network error)'),
-                        '$likeSrvError'    => $l10n->t('Like not successfull (Backend error)'),                                                                                                                  
-                        '$dislikeSrvError' => $l10n->t('Dislike not successfull (Backend error)'),
-                        '$annonSrvError'   => $l10n->t('Sharing not successfull (Backend error)'),
+                        '$likeError'       => $l10n->t('Like not successfull'),
+                        '$dislikeError'    => $l10n->t('Dislike not successfull'),
+                        '$announceError'   => $l10n->t('Sharing not successfull'),
+                        '$srvError'        => $l10n->t('Backend error'),
+                        '$netError'        => $l10n->t('Network error'),
                ]) . $this->page['htmlhead'];
        }
 
index f6d681203ed955b1152bdea62cb9f3d2f34ded26..a94bd560b2d3f1aa0cf1ae233617ef5f0d8b0682 100644 (file)
@@ -851,7 +851,8 @@ function doActivityItemAction(ident, verb, un) {
                        $('button[id^=shareMenuOptions-' + ident.toString() + '] i:first-child').addClass('fa-share');
                        $('button[id^=' + verb + '-' + ident.toString() + '] i:first-child').addClass(thumbsClass);
                        $('a[id^=' + verb + '-' + ident.toString() + '] i:first-child').addClass(thumbsClass);
-      $.jGrowl(aActSrvErr[verb], {sticky: false, theme: 'info', life: 5000});
+                       $('a[id^=' + verb + '-' + ident.toString() + '] i:first-child').addClass(thumbsClass);
+      $.jGrowl(aActErr[verb] + '<br>(' + aErrType['srvErr'] + ')', {sticky: false, theme: 'info', life: 5000});
                }
        })
        .error(function(data){
@@ -860,7 +861,7 @@ function doActivityItemAction(ident, verb, un) {
                        $('button[id^=shareMenuOptions-' + ident.toString() + '] i:first-child').addClass('fa-share');
                        $('button[id^=' + verb + '-' + ident.toString() + '] i:first-child').addClass(thumbsClass);
                        $('a[id^=' + verb + '-' + ident.toString() + '] i:first-child').addClass(thumbsClass);
-      $.jGrowl(aActNetErr[verb], {sticky: false, theme: 'info', life: 5000});
+      $.jGrowl(aActErr[verb] + '<br>(' + aErrType['netErr'] + ')', {sticky: false, theme: 'info', life: 5000});
        });
 }
 
index 540009c82d2145ebf54b036e4ed982823c387d61..39445a0ac1861f17f49857376f2b0ff13d9ab6b2 100644 (file)
@@ -10,14 +10,13 @@ They are loaded into the html <head> so that js functions can use them *}}
                'blockAuthor'  : "{{$blockAuthor|escape:'javascript' nofilter}}",
                'ignoreAuthor' : "{{$ignoreAuthor|escape:'javascript' nofilter}}",
        };
-        var aActNetErr = {
-               'like'         : "{{$likeNetError}}",                                                                                                                                                             
-               'dislike'      : "{{$dislikeNetError}}",
-               'announce'     : "{{$annonNetError}}",
+        var aActErr = {
+               'like'          : "{{$likeError}}",
+               'dislike'       : "{{$dislikeError}}",
+               'announce'      : "{{$announceError}}",
         };
-        var aActSrvErr = {
-               'like'         : "{{$likeSrvError}}",
-               'dislike'      : "{{$dislikeSrvError}}",
-               'announce'     : "{{$annonSrvError}}",
+        var aErrType = {
+               'srvErr'        : "{{$srvError}}",
+               'netErr'        : "{{$netError}}",
         };
 </script>