From: rabuzarus <> Date: Sat, 25 Jun 2016 11:02:53 +0000 (+0200) Subject: frio: Wallmessage - distinguish between own and foreign host X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=84263ee8de7d54c0b48b704852d94ec26f3404e5;p=friendica.git frio: Wallmessage - distinguish between own and foreign host --- diff --git a/view/theme/frio/js/modal.js b/view/theme/frio/js/modal.js index 0279b1c72e..15a4f7f6e6 100644 --- a/view/theme/frio/js/modal.js +++ b/view/theme/frio/js/modal.js @@ -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); + } +} diff --git a/view/theme/frio/templates/profile_vcard.tpl b/view/theme/frio/templates/profile_vcard.tpl index 5d9fad774c..4ede0a9886 100644 --- a/view/theme/frio/templates/profile_vcard.tpl +++ b/view/theme/frio/templates/profile_vcard.tpl @@ -61,7 +61,7 @@ {{/if}} {{if $wallmessage}}