From 230fc28d8a72e75a8f2af2ab5fa5ee0e3ccca4a1 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 11 Mar 2016 20:16:03 +0200 Subject: MAINT-6097 FIXED On required update, clicking link to release notes opens browser behind menu --- indra/llui/lltextbase.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'indra/llui/lltextbase.cpp') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 4309e6557e..4ccf1ef009 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -164,6 +164,7 @@ LLTextBase::Params::Params() trusted_content("trusted_content", true), use_ellipses("use_ellipses", false), parse_urls("parse_urls", false), + force_urls_external("force_urls_external", false), parse_highlights("parse_highlights", false) { addSynonym(track_end, "track_bottom"); @@ -216,6 +217,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mWordWrap(p.wrap), mUseEllipses( p.use_ellipses ), mParseHTML(p.parse_urls), + mForceUrlsExternal(p.force_urls_external), mParseHighlights(p.parse_highlights), mBGVisible(p.bg_visible), mScroller(NULL), @@ -1937,7 +1939,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) registrar.add("Url.Open", boost::bind(&LLUrlAction::openURL, url)); registrar.add("Url.OpenInternal", boost::bind(&LLUrlAction::openURLInternal, url)); registrar.add("Url.OpenExternal", boost::bind(&LLUrlAction::openURLExternal, url)); - registrar.add("Url.Execute", boost::bind(&LLUrlAction::executeSLURL, url)); + registrar.add("Url.Execute", boost::bind(&LLUrlAction::executeSLURL, url, true)); registrar.add("Url.Block", boost::bind(&LLUrlAction::blockObject, url)); registrar.add("Url.Teleport", boost::bind(&LLUrlAction::teleportToLocation, url)); registrar.add("Url.ShowProfile", boost::bind(&LLUrlAction::showProfile, url)); @@ -3227,7 +3229,15 @@ BOOL LLNormalTextSegment::handleMouseUp(S32 x, S32 y, MASK mask) // Only process the click if it's actually in this segment, not to the right of the end-of-line. if(mEditor.getSegmentAtLocalPos(x, y, false) == this) { - LLUrlAction::clickAction(getStyle()->getLinkHREF(), mEditor.isContentTrusted()); + std::string url = getStyle()->getLinkHREF(); + if (!mEditor.mForceUrlsExternal) + { + LLUrlAction::clickAction(url, mEditor.isContentTrusted()); + } + else if (!LLUrlAction::executeSLURL(url, mEditor.isContentTrusted())) + { + LLUrlAction::openURLExternal(url); + } return TRUE; } } -- cgit v1.2.3