diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2015-02-25 17:02:06 -0500 |
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2015-02-25 17:02:06 -0500 |
| commit | 2ab9678455ce2e894273cae1efd2e10f4aaee42b (patch) | |
| tree | ce679a7b789d75a3d36816438c5a2fd5a5edfd1a /indra/llui/llurlentry.cpp | |
| parent | d2de97ad8e84eedd42f4a0fe5b258617a96f154b (diff) | |
| parent | 9b45bc992edf8d049d8a1abe2e778870a493295a (diff) | |
merge
Diffstat (limited to 'indra/llui/llurlentry.cpp')
| -rwxr-xr-x | indra/llui/llurlentry.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index be583c83d8..c06d6144b9 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -31,6 +31,7 @@ #include "lluri.h" #include "llurlmatch.h" #include "llurlregistry.h" +#include "lluriparser.h" #include "llavatarnamecache.h" #include "llcachename.h" @@ -38,6 +39,8 @@ #include "lluicolortable.h" #include "message.h" +#include "uriparser/Uri.h" + #define APP_HEADER_REGEX "((x-grid-location-info://[-\\w\\.]+/app)|(secondlife:///app))" // Utility functions @@ -342,6 +345,30 @@ 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(:\\d{1,5})?(/\\S*)?\\b", + boost::regex::perl|boost::regex::icase); + + mIcon = "Hand"; + mMenuName = "menu_url_http.xml"; +} + +std::string LLUrlEntrySeconlifeURL::getLabel(const std::string &url, const LLUrlLabelCallback &cb) +{ + LLUriParser up(url); + up.extractParts(); + return up.host(); +} + +std::string LLUrlEntrySeconlifeURL::getTooltip(const std::string &url) const +{ + return 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 |
