summaryrefslogtreecommitdiff
path: root/indra/newview/llweb.cpp
diff options
context:
space:
mode:
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);
+}