diff options
author | Cinder Biscuits <cinder@alchemyviewer.org> | 2015-02-26 14:55:50 -0700 |
---|---|---|
committer | Cinder Biscuits <cinder@alchemyviewer.org> | 2015-02-26 14:55:50 -0700 |
commit | d9673d6c1d67ac104fc7872ea2da88560832dd28 (patch) | |
tree | b2ab207152ee7b025eab69eed03733819bdf3d05 /indra/llui/llurlentry.cpp | |
parent | 4665d35453f00fcccd6e17ea84d0549f62b07c5f (diff) | |
parent | d4a2e9fd9a0e7001a6c824ddd6cf37039a632b9d (diff) |
Merged lindenlab/viewer-tools-update into default
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 c058ad6f7d..7e4104c49b 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 |