diff options
| author | Merov Linden <merov@lindenlab.com> | 2015-02-27 15:32:37 -0800 |
|---|---|---|
| committer | Merov Linden <merov@lindenlab.com> | 2015-02-27 15:32:37 -0800 |
| commit | 11d9bf65171016f8c248567dfc743f00b82e9896 (patch) | |
| tree | cc0dbed061ff8da81eaff44707d4e8e7593640c1 /indra/llui/llurlentry.cpp | |
| parent | 0177f56fc92536b7fe0c8139ae1e081fd09eacfe (diff) | |
| parent | 9b45bc992edf8d049d8a1abe2e778870a493295a (diff) | |
Pull merge from lindenlab/viewer-release
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 |
