]> git.mxchange.org Git - friendica.git/commitdiff
frio: Wallmessage - distinguish between own and foreign host
authorrabuzarus <>
Sat, 25 Jun 2016 11:02:53 +0000 (13:02 +0200)
committerrabuzarus <>
Sat, 25 Jun 2016 11:02:53 +0000 (13:02 +0200)
view/theme/frio/js/modal.js
view/theme/frio/templates/profile_vcard.tpl

index 0279b1c72e590c5e5b62254a6f3ce3da66ffa445..15a4f7f6e63905ec515071c5c841416d4b7d2a5a 100644 (file)
@@ -293,3 +293,19 @@ function toggleJotNav (elm) {
        $(elm).parent("li").addClass("active");
 }
 
+// Wall Message needs a special handling because in some cases
+// it redirects you to your own server. In such cases we can't
+// load it into a modal
+function openWallMessage(url) {
+       // split the the url in its parts
+       var parts = parseUrl(url);
+
+       // If the host isn't the same we can't load it in a modal.
+       // So we will go to to the url directly
+       if( ("host" in parts) && (parts.host !== window.location.host)) {
+               window.location.href = url;
+       } else {
+               // otherwise load the wall message into a modal
+               addToModal(url);
+       }
+}
index 5d9fad774c0a1a0d3fbd9c1506c9b03e6abd862a..4ede0a98862e0b3ce55990bfec8bd6ae36e30c20 100644 (file)
@@ -61,7 +61,7 @@
                                {{/if}}
                                {{if $wallmessage}}
                                <div id="wallmessage-link-botton">
-                                       <a id="wallmessage-link" class="btn btn-labeled btn-primary btn-sm" onclick="addToModal('{{$wallmessage_link}}')">
+                                       <a id="wallmessage-link" class="btn btn-labeled btn-primary btn-sm" onclick="openWallMessage('{{$wallmessage_link}}')">
                                                <span class=""><i class="fa fa-envelope"></i></span>
                                                <span class="">{{$wallmessage}}</span>
                                        </a>