diff options
author | maksymsproductengine <maksymsproductengine@lindenlab.com> | 2014-10-02 18:20:10 +0300 |
---|---|---|
committer | maksymsproductengine <maksymsproductengine@lindenlab.com> | 2014-10-02 18:20:10 +0300 |
commit | a25748e11ea59d72f8190373be5b8930288d4744 (patch) | |
tree | ddfebd4b4a738c7b636427b9ba469929b81627a5 /indra/llui/llurlentry.cpp | |
parent | d95feec8dc38dad52f5265a9abc58175019c6d18 (diff) |
MAINT-4119 FIXED Uniquely decorate links on Second Life or Linden Lab domains
Diffstat (limited to 'indra/llui/llurlentry.cpp')
-rwxr-xr-x | indra/llui/llurlentry.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
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" @@ -342,6 +343,35 @@ 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*", + 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 // x-grid-location-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about |