From a25748e11ea59d72f8190373be5b8930288d4744 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Thu, 2 Oct 2014 18:20:10 +0300 Subject: MAINT-4119 FIXED Uniquely decorate links on Second Life or Linden Lab domains --- indra/llui/llurlentry.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'indra/llui/llurlentry.cpp') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index be583c83d8..3ebf06eefa 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -35,6 +35,7 @@ #include "llavatarnamecache.h" #include "llcachename.h" #include "lltrans.h" +#include "lltextutil.h" #include "lluicolortable.h" #include "message.h" @@ -341,6 +342,35 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const return url.substr(pos, url.size() - pos); } +// +// LLUrlEntrySeconlifeURLs Describes *secondlife.com and *lindenlab.com urls to substitute icon 'hand.png' before link +// +LLUrlEntrySeconlifeURL::LLUrlEntrySeconlifeURL() +{ + mPattern = boost::regex("\\b(https?://)?([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com\\S*", + boost::regex::perl|boost::regex::icase); + + mIcon = "Hand"; + mMenuName = "menu_url_http.xml"; +} + +std::string LLUrlEntrySeconlifeURL::getLabel(const std::string &url, const LLUrlLabelCallback &cb) +{ + std::string local_url(url); + + LLTextUtil::Uri uri; + LLTextUtil::normalizeUri(local_url, &uri); + + return uri.host; +} + +std::string LLUrlEntrySeconlifeURL::getTooltip(const std::string &url) const +{ + std::string local_url(url); + LLTextUtil::normalizeUri(local_url); + return local_url; +} + // // LLUrlEntryAgent Describes a Second Life agent Url, e.g., // secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about -- cgit v1.2.3 From 6ea75fd4b03ce3a9155781764c9bcf13a637b749 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Tue, 7 Oct 2014 18:59:11 +0300 Subject: MAINT-4548 & MAINT-4557 FIXED build issues --- indra/llui/llurlentry.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'indra/llui/llurlentry.cpp') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 3ebf06eefa..c06d6144b9 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -31,14 +31,16 @@ #include "lluri.h" #include "llurlmatch.h" #include "llurlregistry.h" +#include "lluriparser.h" #include "llavatarnamecache.h" #include "llcachename.h" #include "lltrans.h" -#include "lltextutil.h" #include "lluicolortable.h" #include "message.h" +#include "uriparser/Uri.h" + #define APP_HEADER_REGEX "((x-grid-location-info://[-\\w\\.]+/app)|(secondlife:///app))" // Utility functions @@ -346,8 +348,8 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const // LLUrlEntrySeconlifeURLs Describes *secondlife.com and *lindenlab.com urls to substitute icon 'hand.png' before link // LLUrlEntrySeconlifeURL::LLUrlEntrySeconlifeURL() -{ - mPattern = boost::regex("\\b(https?://)?([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com\\S*", +{ + mPattern = boost::regex("\\b(https?://)?([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(:\\d{1,5})?(/\\S*)?\\b", boost::regex::perl|boost::regex::icase); mIcon = "Hand"; @@ -356,19 +358,14 @@ LLUrlEntrySeconlifeURL::LLUrlEntrySeconlifeURL() std::string LLUrlEntrySeconlifeURL::getLabel(const std::string &url, const LLUrlLabelCallback &cb) { - std::string local_url(url); - - LLTextUtil::Uri uri; - LLTextUtil::normalizeUri(local_url, &uri); - - return uri.host; + LLUriParser up(url); + up.extractParts(); + return up.host(); } std::string LLUrlEntrySeconlifeURL::getTooltip(const std::string &url) const { - std::string local_url(url); - LLTextUtil::normalizeUri(local_url); - return local_url; + return url; } // -- cgit v1.2.3