summaryrefslogtreecommitdiff
path: root/indra/newview/llweb.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2009-12-18 13:24:29 -0600
committerDave Parks <davep@lindenlab.com>2009-12-18 13:24:29 -0600
commit6aa71844a8949ab3c75b6cbe1a5f8cb811aa27b8 (patch)
treee73b1d2847a33c7568688f85265913a69d1711a2 /indra/newview/llweb.cpp
parent5015886e1763887f534321790d56b6cee5a75dfa (diff)
parentd5b53eb483ec042d83859ec957dce7699c7469aa (diff)
Merge with viewer-2-0
Diffstat (limited to 'indra/newview/llweb.cpp')
-rw-r--r--indra/newview/llweb.cpp36
1 files changed, 31 insertions, 5 deletions
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index 72431bd22f..f8bb7336db 100644
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -38,14 +38,20 @@
// Library includes
#include "llwindow.h" // spawnWebBrowser()
-#include "llviewerwindow.h"
-#include "llviewercontrol.h"
+#include "llappviewer.h"
#include "llfloatermediabrowser.h"
#include "llfloaterreg.h"
-#include "llalertdialog.h"
+#include "lllogininstance.h"
+#include "llsd.h"
#include "lltoastalertpanel.h"
+#include "llui.h"
+#include "lluri.h"
+#include "llversioninfo.h"
+#include "llviewercontrol.h"
+#include "llviewernetwork.h"
+#include "llviewerwindow.h"
-class URLLoader : public LLAlertURLLoader
+class URLLoader : public LLToastAlertPanel::URLLoader
{
virtual void load(const std::string& url , bool force_open_externally)
{
@@ -65,7 +71,6 @@ static URLLoader sAlertURLLoader;
// static
void LLWeb::initClass()
{
- LLAlertDialog::setURLLoader(&sAlertURLLoader);
LLToastAlertPanel::setURLLoader(&sAlertURLLoader);
}
@@ -124,3 +129,24 @@ std::string LLWeb::escapeURL(const std::string& url)
}
return escaped_url;
}
+
+//static
+std::string LLWeb::expandURLSubstitutions(const std::string &url,
+ const LLSD &default_subs)
+{
+ LLSD substitution = default_subs;
+ substitution["VERSION"] = LLVersionInfo::getVersion();
+ substitution["VERSION_MAJOR"] = LLVersionInfo::getMajor();
+ substitution["VERSION_MINOR"] = LLVersionInfo::getMinor();
+ substitution["VERSION_PATCH"] = LLVersionInfo::getPatch();
+ substitution["VERSION_BUILD"] = LLVersionInfo::getBuild();
+ substitution["CHANNEL"] = LLVersionInfo::getChannel();
+ substitution["LANGUAGE"] = LLUI::getLanguage();
+ substitution["GRID"] = LLViewerLogin::getInstance()->getGridLabel();
+ substitution["OS"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple();
+
+ std::string expanded_url = url;
+ LLStringUtil::format(expanded_url, substitution);
+
+ return LLWeb::escapeURL(expanded_url);
+}